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

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -