Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] calling functions with parameters
- From: mwarden at gmail.com (Matt Warden)
- Subject: [Javascript] calling functions with parameters
- Date: Sat Jul 23 11:28:59 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-----
- References:
- [Javascript] calling functions with parameters
- From: Tim Burgan
- [Javascript] calling functions with parameters
- Prev by Date: [Javascript] JavaScript books
- Next by Date: [Javascript] Measuring time to load page
- Previous by thread: [Javascript] calling functions with parameters
- Next by thread: [Javascript] Measuring time to load page
- Index(es):