PDA

View Full Version : calling a function onLoad does not work


valeria_vi
08-13-2002, 09:31 PM
the url for the page is http://nimlok.net/ecommerce/test/specbook/nimlink.mv

onLoad I am trying to call a function begin_color()
it is contained in a .js file that can be found at http://nimlok.net/ecommerce/test/specbook/specbook_nav1.js
i put an alert box there just for the testing purposes.

i cannot fugure out why the function is not being called. I have tried re-naming it all kids of names just to make sure there is not conflict in any var names 'cause i have a dynamic menu on the page, but it did not help.
i am truly puzzled with something seemingly this simple.
any help?
thanks

valeria_vi
08-13-2002, 10:34 PM
i had to put window.onLoad = begin_color(); into a .js file from the dynamic menu that's on the page and it works__now.
go figure.

adios
08-13-2002, 11:31 PM
...go figure.

Exactly. This:

window.onLoad = begin_color();

...won't work; this will:

window.onload = begin_color; :D

valeria_vi
08-14-2002, 03:10 PM
Originally posted by adios


Exactly. This:

window.onLoad = begin_color();

...won't work; this will:

window.onload = begin_color; :D

LOL adios,
i actually used the correct syntax in my code, but it did not work until i put it into a specific .js file from teh dynamic menu i have on the page. :)