'bannerADrotator未定义'的错误!
今天在维护集团网站的时候,也出现了 'bannerADrotator未定义'的错误!
网上搜了一下,也有朋友出现这个问题,也有解决方法,拷过去以备用!
出现错误的源码:
今天在维护集团网站的时候,也出现了 'bannerADrotator未定义'的错误!
网上搜了一下,也有朋友出现这个问题,也有解决方法,拷过去以备用!
出现错误的源码:
Code
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题页</title>
<script language=JavaScript>
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="Image/1.jpg"
bannerADlink[0]="http://www.sina.com/";
bannerAD[1]="Image/2.jpg"
bannerADlink[1]="http://www.it365cn.com/";
bannerAD[2]="Image/3.jpg"
bannerADlink[2]="http://www.163.com/";
bannerAD[3]="Image/4.jpg"
bannerADlink[3]="http://www.sohu.com/";
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
</head>
<body>
<table>
<tr>
<td colspan="2">
<uc1:head ID="Head1" runat="server" />
</td>
</tr>
<tr>
<td style="width: 476px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width: 250px; height: 250px">
<tr>
<td bgcolor="#3568AC"></td>
<td height="210" colspan="3" align="center" valign="top" class="cn" style="width: 272px"><br>
<A onmouseover="displayStatusMsg();return document.returnValue" href="javascript:jump2url()" onFocus="if(this.blur)this.blur()"><img style="FILTER: revealTrans(duration=2,transition=20)" src="Image/1.jpg" width="250" height="250" border="0" name=bannerADrotator></a>
<SCRIPT language=JavaScript>nextAd()</SCRIPT> </td>
<td bgcolor="#3568AC" style="width: 1px"></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="484,9,636,28" href="http://www.it365cn.com" target="_blank" onFocus="if(this.blur)this.blur()">
</map>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题页</title>
<script language=JavaScript>
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="Image/1.jpg"
bannerADlink[0]="http://www.sina.com/";
bannerAD[1]="Image/2.jpg"
bannerADlink[1]="http://www.it365cn.com/";
bannerAD[2]="Image/3.jpg"
bannerADlink[2]="http://www.163.com/";
bannerAD[3]="Image/4.jpg"
bannerADlink[3]="http://www.sohu.com/";
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
</head>
<body>
<table>
<tr>
<td colspan="2">
<uc1:head ID="Head1" runat="server" />
</td>
</tr>
<tr>
<td style="width: 476px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width: 250px; height: 250px">
<tr>
<td bgcolor="#3568AC"></td>
<td height="210" colspan="3" align="center" valign="top" class="cn" style="width: 272px"><br>
<A onmouseover="displayStatusMsg();return document.returnValue" href="javascript:jump2url()" onFocus="if(this.blur)this.blur()"><img style="FILTER: revealTrans(duration=2,transition=20)" src="Image/1.jpg" width="250" height="250" border="0" name=bannerADrotator></a>
<SCRIPT language=JavaScript>nextAd()</SCRIPT> </td>
<td bgcolor="#3568AC" style="width: 1px"></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="484,9,636,28" href="http://www.it365cn.com" target="_blank" onFocus="if(this.blur)this.blur()">
</map>
</body>
</html>
改正后的代码:
Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题页</title>
<script language="javascript" type="text/javascript">
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="Image/1.jpg"
bannerADlink[0]="http://www.sina.com/";
bannerAD[1]="Image/2.jpg"
bannerADlink[1]="http://www.it365cn.com/";
bannerAD[2]="Image/3.jpg"
bannerADlink[2]="http://www.163.com/";
bannerAD[3]="Image/4.jpg"
bannerADlink[3]="http://www.sohu.com/";
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
document.all("bannerADrotator").filters.revealTrans.Transition=Math.floor(Math.random()*23);
document.all("bannerADrotator").filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
document.all("bannerADrotator").filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.all("bannerADrotator").src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
</head>
<body>
<form runat="server" id="form1" >
<table>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td style="width: 476px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width: 250px; height: 250px">
<tr>
<td bgcolor="#3568AC"></td>
<td height="210" colspan="3" align="center" valign="top" class="cn" style="width: 272px"><br>
<A onmouseover="displayStatusMsg();return document.returnValue" href="javascript:jump2url()" onFocus="if(this.blur)this.blur()"><img style="FILTER: revealTrans(duration=2,transition=20)" src="Image/1.jpg" width="250" height="250" border="0" name=bannerADrotator></a>
<SCRIPT language="JavaScript" type="text/javascript">nextAd()</SCRIPT> </td>
<td bgcolor="#3568AC" style="width: 1px"></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="484,9,636,28" href="http://www.it365cn.com" target="_blank" onFocus="if(this.blur)this.blur()">
</map>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!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 id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题页</title>
<script language="javascript" type="text/javascript">
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="Image/1.jpg"
bannerADlink[0]="http://www.sina.com/";
bannerAD[1]="Image/2.jpg"
bannerADlink[1]="http://www.it365cn.com/";
bannerAD[2]="Image/3.jpg"
bannerADlink[2]="http://www.163.com/";
bannerAD[3]="Image/4.jpg"
bannerADlink[3]="http://www.sohu.com/";
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
document.all("bannerADrotator").filters.revealTrans.Transition=Math.floor(Math.random()*23);
document.all("bannerADrotator").filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
document.all("bannerADrotator").filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.all("bannerADrotator").src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
</head>
<body>
<form runat="server" id="form1" >
<table>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td style="width: 476px">
</td>
<td style="width: 100px">
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width: 250px; height: 250px">
<tr>
<td bgcolor="#3568AC"></td>
<td height="210" colspan="3" align="center" valign="top" class="cn" style="width: 272px"><br>
<A onmouseover="displayStatusMsg();return document.returnValue" href="javascript:jump2url()" onFocus="if(this.blur)this.blur()"><img style="FILTER: revealTrans(duration=2,transition=20)" src="Image/1.jpg" width="250" height="250" border="0" name=bannerADrotator></a>
<SCRIPT language="JavaScript" type="text/javascript">nextAd()</SCRIPT> </td>
<td bgcolor="#3568AC" style="width: 1px"></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="484,9,636,28" href="http://www.it365cn.com" target="_blank" onFocus="if(this.blur)this.blur()">
</map>
</form>
</body>
</html>