日期:2014-05-18  浏览次数:20365 次

求助。eval的使用
自学中,看到这样的语句   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 ">
        &nbsp; <table   cellspacing= "0 "   cellpadding= "0 ">