作了个动态图片切换效果IE浏览没问题,可firefox却出现什么has no properties的错误,在线等待。。。 1、把 JS 放在body下面试一下2、保证 imageTitle 只有一个 因为 ID 具有唯一性 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 FILTER 在 firefox 中 是不能使用的 放在body里,还是出has no property的错误 <body><div id="imageTitle"></div></body><script language="JavaScript"><!--document.getElementById("imageTitle").innerHTML = "test";//--></script> 放到body后,MF里提示uncaught excepiton.. window.nextAD错误 还有什么办法?最起码不能让他在firefox下报错 <IMG style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:nextAd()" name=imgUrlrotator height=200 width=381 border=0></A>其中的src="javascript:nextAd()"是什么用法,没有见过,能否解释一下 把输出的HTML贴出来。不要让我们看你的服务器端的代码。 <HTML><HEAD><TITLE></TITLE><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><META content="MSHTML 6.00.2800.1561" name=GENERATOR></HEAD><BODY leftMargin=0 topMargin=0> <TABLE height="100" cellSpacing=0 cellPadding=0 width=381 border=0> <TBODY> <TR id=CanRunScript > <TD vAlign=center align=left height="200"><A id=Link target='_blank' href=""> <IMG style="FILTER: revealTrans(duration=2,transition=20)"src="javascript:nextAd()" name=imgUrlrotator height=200 width=381 border=0></A> </TD> </TR> <TR > <TD><A id=TempLink target='_blank' href=""><div id="imageTitle"></div></A> </TD> </TR> </TBODY></TABLE> </BODY> <SCRIPT language="JavaScript">var imgUrl = new Array();var imgTitle = new Array();var imgLink = new Array();var imgnum = new Array();var adNum=0;imgUrl[0] = "http://mywiki.koook.com/upload/singer/0/24/s_musicbox_anniu_20_eOqmepni56UQ.gif";imgTitle[0] = "ddddd";imgLink[0] = "2006-10-12";imgUrl[1] = "http://mywiki.koook.com/upload/singer/0/24/s_loading_CHF5sELl892F.gif";imgTitle[1] = "猫猫啊";imgLink[1] = "2006-10-12";imgUrl[2] = "http://mywiki.koook.com/upload/singer/0/50/s_2_252063_6y0cdLv4u2jw.jpg";imgTitle[2] = "掌心化雪";imgLink[2] = "2006-10-12";function setTransition(){ if (document.all){ imgUrlrotator.filters.revealTrans.Transition=Math.floor(Math.random()*20); imgUrlrotator.filters.revealTrans.apply(); }}function playTransition(){ if (document.all) imgUrlrotator.filters.revealTrans.play()}function nextAd(){ if(adNum<imgUrl.length-1) adNum++ ; else adNum=1; setTransition(); document.images.imgUrlrotator.src = imgUrl[adNum]; document.getElementById("imageTitle").innerHTML = imgTitle[adNum]; document.getElementById("Link").href = imgUrl[adNum]; document.getElementById("TempLink").href = imgLink[adNum]; playTransition(); theTimer=setTimeout("nextAd()", 7000);}</SCRIPT> </HTML> 以上是显示的HTML代码,页面显示地址为:http://mywiki.koook.com/admin/show_pic.php 把js代码放入head<HTML><HEAD><TITLE></TITLE><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><META content="MSHTML 6.00.2800.1561" name=GENERATOR> <SCRIPT language="JavaScript">var imgUrl = new Array();var imgTitle = new Array();var imgLink = new Array();var imgnum = new Array();var adNum=0;imgUrl[0] = "http://mywiki.koook.com/upload/singer/0/24/s_musicbox_anniu_20_eOqmepni56UQ.gif";imgTitle[0] = "ddddd";imgLink[0] = "2006-10-12";imgUrl[1] = "http://mywiki.koook.com/upload/singer/0/24/s_loading_CHF5sELl892F.gif";imgTitle[1] = "猫猫啊";imgLink[1] = "2006-10-12";imgUrl[2] = "http://mywiki.koook.com/upload/singer/0/50/s_2_252063_6y0cdLv4u2jw.jpg";imgTitle[2] = "掌心化雪";imgLink[2] = "2006-10-12";function setTransition(){ if (document.all){ imgUrlrotator.filters.revealTrans.Transition=Math.floor(Math.random()*20); imgUrlrotator.filters.revealTrans.apply(); }}function playTransition(){ if (document.all) imgUrlrotator.filters.revealTrans.play()}function nextAd(){ if(adNum<imgUrl.length-1)adNum++ ; else adNum=1; setTransition(); document.images.imgUrlrotator.src = imgUrl[adNum]; document.getElementById("imageTitle").innerHTML = imgTitle[adNum]; document.getElementById("Link").href = imgUrl[adNum]; document.getElementById("TempLink").href = imgLink[adNum]; playTransition(); theTimer=setTimeout("nextAd", 7000);}</SCRIPT></HEAD><BODY leftMargin=0 topMargin=0> <TABLE height="100" cellSpacing=0 cellPadding=0 width=381 border=0> <TBODY> <TR id=CanRunScript > <TD vAlign=center align=left height="200"><A id=Link target='_blank' href=""><IMG style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:nextAd()" name=imgUrlrotator height=200 width=381 border=0></A> </TD> </TR> <TR > <TD><A id=TempLink target='_blank' href=""><div id="imageTitle"></div></A> </TD> </TR> </TBODY></TABLE> </BODY> </HTML> 因为mozilla与IE中的javascript解释器不同,你在HTML里调用js方法,而前面没有写定义,因此是错误的(在Mozilla中) 下面也是一个例子。ff里会报错<script>o={ foo: function(){ alert("never-online.net"); } }; with (o) { bar(); function bar(){ alert("never-online"); } foo(); }</script> 请问这个发表功能代码写的怎么样??各位评论一下 检测客户端文件~~ 求动态生成如图的表格JS代码,谢谢 按惯例,升星散分!!^_^ 请问下如何在返回母页的时候一起调用一下母页中的一个函数 自定义原型的一个小问题 点击空白地方 只能实现一个DIV隐藏 第二个DIV就不能隐藏了 怎么才能实现两个div都隐藏 各位大神帮忙 问一个正则表达式的问题。 求asp论坛源码,各位兄弟请帮一下忙啊! javascript可以处理post请求不? JSP中表单提交的javascript的问题
<div id="imageTitle"></div>
</body>
<script language="JavaScript">
<!--
document.getElementById("imageTitle").innerHTML = "test";
//-->
</script>
src="javascript:nextAd()"是什么用法,没有见过,能否解释一下
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META content="MSHTML 6.00.2800.1561" name=GENERATOR>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<TABLE height="100" cellSpacing=0 cellPadding=0 width=381 border=0>
<TBODY>
<TR id=CanRunScript >
<TD vAlign=center align=left height="200"><A id=Link target='_blank' href="">
<IMG style="FILTER: revealTrans(duration=2,transition=20)"src="javascript:nextAd()" name=imgUrlrotator height=200 width=381 border=0></A> </TD>
</TR>
<TR >
<TD><A id=TempLink target='_blank' href=""><div id="imageTitle"></div></A>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY>
<SCRIPT language="JavaScript">
var imgUrl = new Array();
var imgTitle = new Array();
var imgLink = new Array();
var imgnum = new Array();
var adNum=0;
imgUrl[0] = "http://mywiki.koook.com/upload/singer/0/24/s_musicbox_anniu_20_eOqmepni56UQ.gif";imgTitle[0] = "ddddd";imgLink[0] = "2006-10-12";imgUrl[1] = "http://mywiki.koook.com/upload/singer/0/24/s_loading_CHF5sELl892F.gif";imgTitle[1] = "猫猫啊";imgLink[1] = "2006-10-12";imgUrl[2] = "http://mywiki.koook.com/upload/singer/0/50/s_2_252063_6y0cdLv4u2jw.jpg";imgTitle[2] = "掌心化雪";imgLink[2] = "2006-10-12";function setTransition(){
if (document.all){
imgUrlrotator.filters.revealTrans.Transition=Math.floor(Math.random()*20);
imgUrlrotator.filters.revealTrans.apply();
}
}function playTransition(){
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<imgUrl.length-1)
adNum++ ;
else
adNum=1;
setTransition();
document.images.imgUrlrotator.src = imgUrl[adNum];
document.getElementById("imageTitle").innerHTML = imgTitle[adNum];
document.getElementById("Link").href = imgUrl[adNum];
document.getElementById("TempLink").href = imgLink[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 7000);
}
</SCRIPT>
</HTML>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<META content="MSHTML 6.00.2800.1561" name=GENERATOR>
<SCRIPT language="JavaScript">
var imgUrl = new Array();
var imgTitle = new Array();
var imgLink = new Array();
var imgnum = new Array();
var adNum=0;
imgUrl[0] = "http://mywiki.koook.com/upload/singer/0/24/s_musicbox_anniu_20_eOqmepni56UQ.gif";imgTitle[0] = "ddddd";imgLink[0] = "2006-10-12";imgUrl[1] = "http://mywiki.koook.com/upload/singer/0/24/s_loading_CHF5sELl892F.gif";imgTitle[1] = "猫猫啊";imgLink[1] = "2006-10-12";imgUrl[2] = "http://mywiki.koook.com/upload/singer/0/50/s_2_252063_6y0cdLv4u2jw.jpg";imgTitle[2] = "掌心化雪";imgLink[2] = "2006-10-12";function setTransition(){
if (document.all){
imgUrlrotator.filters.revealTrans.Transition=Math.floor(Math.random()*20);
imgUrlrotator.filters.revealTrans.apply();
}
}function playTransition(){
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<imgUrl.length-1)
adNum++ ;
else
adNum=1;
setTransition();
document.images.imgUrlrotator.src = imgUrl[adNum];
document.getElementById("imageTitle").innerHTML = imgTitle[adNum];
document.getElementById("Link").href = imgUrl[adNum];
document.getElementById("TempLink").href = imgLink[adNum];
playTransition();
theTimer=setTimeout("nextAd", 7000);
}
</SCRIPT>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<TABLE height="100" cellSpacing=0 cellPadding=0 width=381 border=0>
<TBODY>
<TR id=CanRunScript >
<TD vAlign=center align=left height="200"><A id=Link target='_blank' href="">
<IMG style="FILTER: revealTrans(duration=2,transition=20)" src="javascript:nextAd()" name=imgUrlrotator height=200 width=381 border=0></A> </TD>
</TR>
<TR >
<TD><A id=TempLink target='_blank' href=""><div id="imageTitle"></div></A>
</TD>
</TR>
</TBODY>
</TABLE>
</BODY> </HTML>
o={
foo: function(){
alert("never-online.net");
}
};
with (o) {
bar();
function bar(){
alert("never-online");
}
foo();
}
</script>