Javascript works inline but not in a file -
i new javascript , assuming answer simple , right under nose, can't seem find proverbial dog that's going bite me.
anyway, works inline:
<script language="javascript"> function foo(){ alert("boo!") } </script> <body onload=foo()>...
but if do:
<script type="text\javascript" scr="js/blah.js"> </script> <body onload=foo()>
blah.js contains:
function foo(){ alert("boo!") }
that doesn't work.
why?
the correct syntax is:
<body onload="foo();">
Comments
Post a Comment