Pop-up window
Advantages: compatibility is good, and I think there should be no interception tools to intercept
Advantages: Very Short Code
Disadvantage: the page must be clicked before it pops up
Demo
Run Code Box
<pead><style> #link001 img {border-style:none;} </style><script>function cancelopennew () {if (!window.event) {settimeout (cancelopennewa,1000); return;} var obj=window.event.srcelement; if (!obj) return; if (!obj.tagname) return; if (String (obj.tagname). Match (/input|select|option|textarea/i)) return; SetTimeout (cancelopennewa,1000);} function Cancelopennewa () {Document.body.appendChild (document.getElementById (' MainDiv001 '));} </script></pead><body><a href= "http://www.blueidea.com" target= "_blank" id= "link001" Color:black; Text-decoration:none; Cursor:default; Display:block "hidefocus=" true "><div id=" MainDiv001 "><!--this are a comment-->this is a test. <br>i try to put something here.<br><input/><br><div > a div.</div><ol> ; <li> and this</li> <li> is a lIst</li></ol><form> this is a form. <input/><input type= "checkbox"/> <input type= "Radio" name= "Hutia" value= "1"/><input type= "Radio" "Name=" Hutia "value=" 0 "/> <select><option>this is a select</option> <option>this is a Select </option> </select> <textarea> and is a textarea</textarea> <input type= button "Value=" Button "/> <input type=" Submit "value=" submit "/> <input" reset "type=" reset "value= iframe src= "http://www.blueidea.com" ></iframe><!--This is another comment--></div></a> </body>
[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]
Description
1. To ensure that the IMG on the page does not appear ugly border
<style>
#link001 img {border-style:none;}
</style>
2. Ensure window only pops up once
<script>
function Cancelopennew () {
if (!window.event) {settimeout (cancelopennewa,1000); return;}
var obj=window.event.srcelement;
if (!obj) return;
if (!obj.tagname) return;
if (String (obj.tagname). Match (/input|select|option|textarea/i)) return;
SetTimeout (cancelopennewa,1000);
}
function Cancelopennewa () {Document.body.appendChild (document.getElementById (' MainDiv001 '));}
</script>
3. This structure is the root of the window----in fact, just a target= "_blank" link, interception program if even this will stop, I have nothing to say
<body>
<a href= "http://www.blueidea.com" target= "_blank" id= "link001" style=; Text-decoration:none; Cursor:default; Display:block "hidefocus=" True >
<div id= "MainDiv001" >
4. Never forget to add at the end of the page:
</div>
</a>
</body>