[Javascript] calling functions with parameters

Matt Warden mwarden at gmail.com
Sat Jul 23 11:28:54 CDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tim Burgan wrote:
> The code for my function call is (this is the code where the error occurs):
> window.onload = showHideOption("a","popup");

This is going to call showHideOption(...) immediately and then assign
the *return value* to window.onload, whereas you are trying to assign
the function object itself with these certain parameters. Try this:

window.onload = function() {showHideOption("a","popup");};

- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFC4nBGAQ0d4HGyPE8RAusSAJ0Qnjkf5pLnDRQvcF82QrdduJCiiwCcDQfl
6RaIrkg5LJo9pUpYj02CArg=
=mWoc
-----END PGP SIGNATURE-----



More information about the Javascript mailing list