Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a var to a function from the call

Status
Not open for further replies.

gameon

Programmer
Joined
Feb 23, 2001
Messages
325
Location
GB
How do I pass a variable to a function and then use it.

At the mo I am doing:

<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>

<!--- Generate javascript controlers --->
function doit(message)
{
alert('message');
}
</script>

<body onLoad=&quot;doit(bosh);&quot;>

Am I being a muppet?

M@
 
Code:
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>

<!--- Generate javascript controlers --->
function doit(message)
{
   alert(message);
}
</script>

<body onLoad=&quot;doit('bosh');&quot;>

notice the different position of the quote marks.
 
Sorted, cheers - m@
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top