这段js在不同的浏览器上有的报错有的不报错,为什么?(求解)

hero19800203 2009-12-11 09:44:59
代码如下:
<script language="javascript">
<!--
function high(which2){
theobject=which2;
theobject.filters.alpha.opacity=50
highlighting=setInterval("highlightit(theobject)",50)}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=100}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<85)
cur2.filters.alpha.opacity+=3
else if(window.highting)
clearInterval(highlighting)}
function openBigimage(url,param)
{
window.open("../product/show.asp?picturl="+url+"&idx="+param,"open","status=no, toolbar=no, resizable=no,location=no,scrollbars=no, width=1, height=1,top=0,left=0" );
}
//-->

</script>

报错信息:

网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
时间戳: Fri, 11 Dec 2009 13:40:12 UTC


消息: 'theobject.filters.alpha' 为空或不是对象
行: 42
字符: 1
代码: 0
URI: http://localhost/web/


消息: 'highlighting' 未定义
行: 45
字符: 1
代码: 0
URI: http://localhost/web/



...全文
139 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hero19800203 2009-12-11
  • 打赏
  • 举报
回复
我在网上还看到这样一段代码这个怎么不报错呢?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>www.fengfly.com</title>

<script language=JavaScript1.2>
<!--
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",40)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=40
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}
//-->
</script>

<style type="text/css">
<!--
h1 {text-align:center;margin-top:50px;}
p#outer {
margin:0 auto;
width:202px;
}
#outer a {
margin:0px;
display:block;
position: relative;
border:1px solid #ccc;
}
#outer a:hover {border:1px dashed #c00;}
#outer img {display:block;border:none;background:#069;}
-->
</style>
</head>
<body>
<h1>将鼠标移至图片,将看到此效果。</h1>
<p id="outer"><a href="http://www.fengfly.com/"><img onMouseOut=low(this) onMouseOver=high(this) style='FILTER: alpha(opacity=20)' src="http://www.fengfly.com/images/logo.gif" alt="www.fengfly.com" width="200" height="90" /></a>
</p>
</body>
</html>
<a href="http://www.fengfly.com/html/CSS/wangyetexiao/index.html">欢迎访问雨枫技术教程网网页特效集</a>
hero19800203 2009-12-11
  • 打赏
  • 举报
回复
我用IE内核的搜狗浏览器就不报错!这个有什么解决的办法没有啊?
hero19800203 2009-12-11
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 fandelei1982 的回复:]
heobject.filters.alpha好像只有IE支持
[/Quote]我就是在IE8下面调试的!
friendly_ 2009-12-11
  • 打赏
  • 举报
回复
heobject.filters.alpha好像只有IE支持

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧