Click to See Complete Forum and Search --> : not *function* working!!
leprkn
07-02-2003, 12:50 PM
i have a function that's supposed to run when a page is loaded. but when i place onload in the body tag of my page, i get a object expected error.
here's an example...
<!--
<script *blah blah blah>
function myfunct(){
do stuff
}
</script>
-->
here's where i call it:
<body onLoad="myfunct();">
// stuff goes here
</body>
so what am i doing wrong?
Charles
07-02-2003, 12:56 PM
I think hat you problem is on line 5 of your page, but just to be sure you might want to give us the URL.
leprkn
07-02-2003, 01:14 PM
i'm not exactly sure what you meant but heres a link:
www.ididntdoit.net/testpage
use the full url or the page won't display and i have no link to it on the site yet...
Charles
07-02-2003, 01:25 PM
If you had enabled your error reporting then you would have quickly found a problematic ';' on your page that does not exist in your post above.
leprkn
07-02-2003, 01:47 PM
thanks charles, that did the trick
dave, thanks for the input but those tags aren't actually in the script, i just put them there so the post would show and not render the tags.
David Harrison
07-02-2003, 01:59 PM
OK, this is confusing me a bit, so I'm gonna ask about it. inside the script tag I always put this:
<!--
however Dave, for some reason you put this:
<!--//
what's with the js comment tags at the end of the line where there is no comment, if anything I would have thought it would be:
//<!--
David Harrison
07-02-2003, 02:09 PM
Fair 'nuff.
Charles
07-02-2003, 02:11 PM
Except that Dave just deleted my post that demonstrated, with quote and reference and from two different sources (one of which was Netscape) that the slashes are not required.