Created
May 28, 2012 08:18
-
-
Save tokune/2817974 to your computer and use it in GitHub Desktop.
跨域关闭检测
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SCRIPT LANGUAGE="JavaScript"> | |
window.onload=function(){ | |
document.getElementById("open").onclick=function(){ | |
var url="http://pinban.com/oauth/weibo/binding/"; | |
var win=window.open(url); | |
var timer = setInterval((function(win){ | |
return function(){ | |
if (win.closed) { | |
alert("fuck off!!"); | |
clearInterval(timer); | |
} | |
}; | |
})(win),1000); | |
} | |
} | |
</SCRIPT> | |
<input id="open" type="button" value="open"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment