- 爱易网页
-
JavaSript
- html文件中引用javascript文件出现异常
日期:2014-05-16 浏览次数:20379 次
html文件中引用javascript文件出现错误
先请看一下目录结构:
wwwroot
-> w2
-> js
-> myJs.js
-> art.htm
虚拟目录下有一个w2文件夹 它里面有一个js文件夹 里面包含有js文件 w2文件夹里面还有一个art.htm文件 在它里面引用那个js文件 简单吧 但却报了错!报找不到对象 请帮我看看 谢谢
art.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> 艺术爱好 </title>
<style type= "text/css "> .f12px { FONT-SIZE: 12px }
A:link { COLOR: #000000; TEXT-DECORATION: none }
A:visited { COLOR: #cc6666; TEXT-DECORATION: none }
A:active { COLOR: green; TEXT-DECORATION: none }
A:hover { COLOR: red; TEXT-DECORATION: underline }
BODY { BACKGROUND: #fcfff7 }
.t1 { BORDER-RIGHT: #8ab78a 1px solid; BORDER-TOP: #8ab78a 1px solid; DISPLAY: none; FONT-SIZE: 12px; OVERFLOW: auto; BORDER-LEFT: #8ab78a 1px solid; WIDTH: 400px; BORDER-BOTTOM: #8ab78a 1px solid; POSITION: absolute; HEIGHT: 400px; BACKGROUND-COLOR: #fcfff7 }
</style>
<script language= "javascript " src= "../w2/js/myJs.js ">
</script>
</HEAD>
<body>
<table cellSpacing= "1 " cellPadding= "10 " class= "f12px " id= "tbView ">
<tr bgcolor= "#e6f2e7 ">
<td nowrap>
<a id= "view1 " onmousemove= "dis( 'abc ') " onmouseout= "undis( 'abc ') " href= "http://www.abc.com/ " target= "_blank "> abc网 </a>
</td>
<td nowrap>
</td>
<td nowrap>
</td>
<td nowrap>
</td>
</tr>
</table>
<div id= "abc "> abc is good! </div>
</body> </html>
myJs.js
function dis(s)
{
var xxDiv=document.getElementById(s);
xxDiv.style.display= 'block ';
xxDiv.style.left=event.clientX;