您现在的位置是:首页 > 学无止境
如何在重写alert后还能正常弹出alert
转载自:http://www.cnblogs.com/rubylouvre/archive/2012/02/03/2335946.html
//原题目:
window.alert = function(){};______;alert(1); 填空,使后面的alert(1)能正确弹出,至少列...
//原题目:
window.alert = function(){};______;alert(1); 填空,使后面的alert(1)能正确弹出,至少列...
转载自:http://www.cnblogs.com/rubylouvre/archive/2012/02/03/2335946.html
//原题目:
window.alert = function(){};______;alert(1); 填空,使后面的alert(1)能正确弹出,至少列举两种不同思路。解法一,创建新的执行环境,使用iframe沙箱window.alert = function(){};
window.alert=function(obj){
var iframe=document.createElement("iframe");
iframe.src="javascript:void(0);"
document.body.appendChild(iframe)
iframe.contentWindow.alert(obj);
}
alert(1)解法二,创建新的执行环境,打开新窗口window.alert = function(){};
window.alert = function(a){
window.open('','').alert(a)
//window.createPopup().document.parentWindow.alert(a) //IE only
}
alert(1);上一篇:被误解的 Node.js
文章评论
- 登录后评论
点击排行
-
php-fpm安装、配置与优化
转载自:https://www.zybuluo.com/phper/note/89081 1、php中...
-
centos下postgresql的安装与配置
一、安装(以root身份进行)1、检出最新的postgresql的yum配置从ht...
-
Mysql的大小写敏感性
MYSQL在默认的情况下查询是不区分大小写的,例如:CREATE TABLE...
-
关于URL编码
转载自:http://www.ruanyifeng.com/blog/2010/02/url_encoding....
-
header中的Cache-control
网页的缓存是由HTTP消息头中的“Cache-control”来控制的,常见的...