charlie123 — 2009-07-06T01:35:33-04:00 — #1
I have an onload handler that worked fine if applied in <body onload="getCountries()" >, but did not work in <div onload="getCountries()" >. I searched for a while in the forum and got no clue. How to solve this? I need to put it in <div> elements.
Thanks a lot.
wysiwyg — 2009-07-06T01:42:04-04:00 — #2
Either stick that code in the body onload, or place it in a script tag just below the div, like
steve_strong — 2009-07-06T06:24:18-04:00 — #3
there is no "onload" function for div tag
so, if u want to execute the content of <div></div>
first write <div></div> and its content and after that
call the getCountries() function inside the <script></script> tag
i hope this will help you
if u have any query plz post
charlie123 — 2009-07-09T08:19:40-04:00 — #4
Hi wysiwyg & Steve, thanks, that fixed my problem.
I have this line:
in the html head, can I put it in a PHP function and echo this line and use the javscript as if it is in the html head?
steve_strong — 2009-07-21T01:50:32-04:00 — #5
what you are telling is fine, you can proceed