自学中,看到这样的语句 if(br)
{eval(lRef+'www_mingrisoft_com'+CMessages)
eval(lRef+'www_mingrisoft_com'+CloseIt); },应该如何理解?
源代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server">
<style type="text/css">
{
position:absolute;background: #eeffee;//解释框背景色
}
</STYLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
CueMessage=new Array(5)//创建数组
CueMessage[0]="<font color=red><b>欢迎光临明日科技游戏网!</b></font>"
CueMessage[1]="<font color=red><b>进入游戏公告区,您可以了解最近的公告信息!</b></font>"
CueMessage[2]="<font color=red><b>可以帮助您对本站发行的积分进行了解!</b></font>"
CueMessage[3]="<font color=red><b>来这里,您可以知道如何购买本站的产品!</b></font>"
CueMessage[4]="<font color=red><b>为玩家提供交流的社区!</b></font>"
var br;//声明变量.用于指定浏览器
if (document.all)
{
lRef='document.all.'
styleRef='.style.'
CMessages=".innerHTML=CueMessage[num]"
CloseIt=""
br=true
}
else
{
alert("此效果在Netscape浏览器中不能实现!");
}
function www_mingrisoft_com(num)
{
if(br)
{
eval(lRef+'www_mingrisoft_com'+CMessages)
eval(lRef+'www_mingrisoft_com'+CloseIt);
}
}
</SCRIPT>
</head>
<body style="text-align: center">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(0)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">本站首页</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(1)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">游戏公告</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(2)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff;">积分乐园</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(3)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">汇款方式</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(4)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">玩家论坛</span></a>
</td>
</tr>
</table>
<br />
<div id="www_mingrisoft_com" style="left: 220px; top: 69px; width: 299px; height: 40px"></div>
</body>
</html>
{eval(lRef+'www_mingrisoft_com'+CMessages)
eval(lRef+'www_mingrisoft_com'+CloseIt); },应该如何理解?
源代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!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 runat="server">
<style type="text/css">
{
position:absolute;background: #eeffee;//解释框背景色
}
</STYLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
CueMessage=new Array(5)//创建数组
CueMessage[0]="<font color=red><b>欢迎光临明日科技游戏网!</b></font>"
CueMessage[1]="<font color=red><b>进入游戏公告区,您可以了解最近的公告信息!</b></font>"
CueMessage[2]="<font color=red><b>可以帮助您对本站发行的积分进行了解!</b></font>"
CueMessage[3]="<font color=red><b>来这里,您可以知道如何购买本站的产品!</b></font>"
CueMessage[4]="<font color=red><b>为玩家提供交流的社区!</b></font>"
var br;//声明变量.用于指定浏览器
if (document.all)
{
lRef='document.all.'
styleRef='.style.'
CMessages=".innerHTML=CueMessage[num]"
CloseIt=""
br=true
}
else
{
alert("此效果在Netscape浏览器中不能实现!");
}
function www_mingrisoft_com(num)
{
if(br)
{
eval(lRef+'www_mingrisoft_com'+CMessages)
eval(lRef+'www_mingrisoft_com'+CloseIt);
}
}
</SCRIPT>
</head>
<body style="text-align: center">
<table cellspacing="0" cellpadding="0">
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(0)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">本站首页</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(1)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">游戏公告</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(2)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff;">积分乐园</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(3)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">汇款方式</span></a>
</td>
</tr>
<tr>
<td style="height: 30px">
<a href="http://www.mingrisoft.com" onMouseOver="www_mingrisoft_com(4)" onMouseOut="www_mingrisoft_com(5)" target="_blank">
<span style="font-size: 11pt; color: #0000ff">玩家论坛</span></a>
</td>
</tr>
</table>
<br />
<div id="www_mingrisoft_com" style="left: 220px; top: 69px; width: 299px; height: 40px"></div>
</body>
</html>
就是 alert("AAA")
eval是用来执行运算的,你可以理解为 run~~~
根据上下文
就是 eval('document.all.www_mingrisoft_com=.innerHTML=CueMessage[num]')也就是document.all.www_mingrisoft_com.innerHTML=CueMessage[num]以前很流行的故弄玄虚的小伎俩....
能否再进一步解释一下document.all.www_mingrisoft_com.innerHTML?
给您添麻烦了
========================
即
<div id="www_mingrisoft_com" style="left: 220px; top: 69px; width: 299px; height: 40px"></div>
的内部HTML片断,