点击来路不弹的弹窗代码

网络整理 - 09-08

//下列来路不弹

var domainarray=new Array('yunchanfu.com', 'www.yunchanfu.com', 'www.baidu.com', 'www.google.com', );

var hisdomain=document.referrer;

mydomain=hisdomain.split("/");

hisdomain=mydomain[2];

var i=domainarray.length;

var tan="yes";

for(j=0;j<i;j++){

   if(hisdomain==domainarray[j]){

      tan="no";

      break;

   }

}

if(tan=="yes"){

//弹窗代码开始

var cookie = {

        ad0:60,

        ad_num : 1,

        get_cookie : function(Name){var search = Name + "=";        var returnvalue = "";if (document.cookie.length > 0) {offset = document.cookie.indexOf(search);if (offset != -1) {offset += search.length;end = document.cookie.indexOf(";", offset);if (end == -1)end = document.cookie.length;returnvalue=unescape(document.cookie.substring(offset, end));}}return returnvalue;},

        init : function(){

                for(var i=0; i<cookie.ad_num; i++){

                        if(cookie.get_cookie('ppad_cookie_'+i)){

                                continue;

                        }else{

                                var Then = new Date();current_time = eval('cookie.ad'+i);Then.setTime(Then.getTime() + current_time*60*1000);document.cookie='ppad_cookie_'+i+'=1;expires='+ Then.toGMTString()+';path=/;';

                                switch(i){

                                        case 0:

                                                document.write('<script language="javascript" src=""></script>');

                                                //上面更换你要弹出的页面

                                        break;

                                }                               

break;

                        }

                }

        }

}

cookie.init();

//弹窗代码结束

}