日期:2014-05-16  浏览次数:20400 次

强制弹出窗口的javascript
<!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> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Pop Ads</title> 
<script language="javascript"> 
<!--
function ForceWindow ()
{
this.r = document.documentElement;
this.f = document.createElement("FORM");
this.f.target = "_blank";
this.f.method = "post";
this.r.insertBefore(this.f, this.r.childNodes[0]);
}
ForceWindow.prototype.pop = function (sUrl)
{
this.f.action = sUrl;
this.f.submit();
}
window.force = new ForceWindow();
</script> 
</head> 
<body onload="window.force.pop('http://lveyo.iteye.com/')"><br /> 
 
</body> 
</html>


这个一般拦截不了,构造了一个空FORM提交到要打开的URL上,很实用。