首页 > 其他 > 详细

重写Alert

时间:2016-03-17 16:15:49      阅读:242      评论:0      收藏:0      [点我收藏+]

重写Alert

 

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <meta charset="UTF-8">
 5 <title>Insert title here</title>
 6 <script type="text/javascript">
 7 var orginalert = window.alert;
 8 window.alert = function(message){
 9     var frm = document.frm;
10     frm.action = "./popup.html";
11     var winpop = window.open("","targetopoup","width=700,height=500,location=no,resizable=no");//top=0,left=0,
12     frm.target = "targetopoup";
13     frm.submit();
14     frm.target = "";
15     winpop.focus();
16 }
17 
18 function originbuttonclick(){
19     
20     orginalert("orginalert");
21 }
22 function resetbuttonclick(){
23     
24     alert("orginalert");
25 }
26 </script>
27 </head>
28 <body>
29 <input type="button" value="originbutton" onclick="originbuttonclick()"> 
30 <input type="button" value="resetbutton" onclick="resetbuttonclick()"> 
31 <form action="" id = "frm" name="frm">
32 
33 </form>
34 </body>
35 </html>

 

 

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <meta charset="UTF-8">
 5 <title>Insert title here</title>
 6 <script type="text/javascript">
 7 function testload(){
 8     //alert("3434");
 9     window.moveTo(0,0);        
10     window.resizeTo(screen.availWidth,screen.availHeight); 
11     window.outerWidth=screen.availWidth;        
12     window.outerHeight=screen.availHeight;
13 }
14 </script>
15 </head>
16 <body onload="testload()">
17 <h1>hahah</h1>
18 </body>
19 </html>

 

重写Alert

原文:http://www.cnblogs.com/mingluosunshan/p/5287703.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!