|
-
May 1st, 2002, 10:51 AM
#1
Frenzied Member
JavaScript passes variables the same way most modern languages do. JavaScript's syntax is based on Java, which in turn is based on C/C++, which in turn.... Perl, JScript, VB, Fortran, and a host of other languages pass variables in the same way.
Code:
<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
function myFunction (myVar) {
alert(myVar);
}
</script>
</head>
<body>
<p onclick="javascript:myFunction('Foo');">Click Me!</p>
</body>
</html>
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|