无法加载外部的javascript文件
我用的firefox,第一段代码没问题,浏览器能正确显示
然后我写了个外部javascript文件,位置在和html文件同一级的一个Scripts文件夹里,路径就是上面注释掉的那行,里面的代码如第二段,然后就死活无法显示,然后sayHello()这个方法也失效了,谁知道是怎么回事?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Hello,World</title> <script type="text/javascript" defer="defer"> function sayHello() { return ("Hello,World"); } </script> <!--<script type="text/javascript" defer="defer" src="Scripts/JScript.js" />--></head><body> <script type="text/javascript"> document.write(sayHello()); <!--document.write(sayHi());--> </script></body></html>function sayHi() { return ("Hello,World");}