I day this method has a little haha, we do not say to see JS forced pop-up window program code bar.
Write Cookie
function Setcookie (name,value) {
var days = 1;
var exp = new Date ();
Exp.settime (Exp.gettime () + days*24*60*60*1000);
Document.cookie = name + "=" + Escape (value) + "expires=" + exp.togmtstring ();
}
Read cookies
function GetCookie (name) {
var arr,reg=new RegExp ("(^|)" +name+ "= ([^;] *)(;|$)");
if (Arr=document.cookie.match (reg)) return unescape (arr[2]);
else return null;
}
Window.attachevent ("onload", function () {
if (GetCookie ("Popwin")) return false;
var o = document.getElementsByTagName ("a");
for (var i=0; i<o.length; i++) {
O[i].attachevent ("onclick", function () {
if (!getcookie ("Popwin")) {
Setcookie ("Popwin", "true");
window.open (http://www.111cn.net, "Popwin", "height=700, width=500, Top=0, left=1000, Toolbar=yes, Menubar=yes, Scrollbars=yes, Resizable=yes, Location=yes, Status=yes ");
Window.focus ();
}
});
}
});
After I guess, study, come to this conclusion. Taobao with JS to each link (that is, a tag) plus a pop-up window code. It then judges cookies, pops up and writes cookies to a user who does not have a pop-up ad click on any link. If the user pops up, click on all links on the normal link, do not pop up