First look at a common window.open open window instance
The code is as follows |
Copy Code |
<SCRIPT> <!-- window.open (' page.html ', ' newwindow ', ' Height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, Resizable=no,location=no, Status=no ') Write a line --> </SCRIPT>
|
After the script is run, page.html will be opened in the new form NewWindow, wide 100, high 400, 0 pixels from the top of the screen, 0 pixels from the screen, no toolbar, no menu bar, no scroll bar, no resizing, no address bar, no status bar, but the result is not open, The check later found that the browser window.open the solution, and later found a piece of code to solve the problem.
Look at the code directly
The code is as follows |
Copy Code |
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<title></title>
<script type= "Text/javascript" src= "Http://code.jquery.com/jquery-1.4.1.min.js" ></script>
<script type= "Text/javascript" >
<!-- $(
function ()
{
Method One
window.showModalDialog ("http://www.111cn.net/");
window.showModalDialog ("http://www.111cn.net/");
Method Two
var aa=window.open ();
settimeout (function () {
Aa.location= "Http://www.111cn.net";
}, 100);
var b=window.open (); settimeout (function () {
B.location= "Http://www.111cn.net";
}, 200);
var c=window.open ();
settimeout (function () {
C.location= "Http://www.111cn.net";
}, 300);
var d=window.open ();
settimeout (function () {
D.location= "Http://www.111cn.net";
}, 400);
var ee=window.open ();
settimeout (function () {
Ee.location= "Http://www.111cn.net";
}, 500);
var f=window.open ();
settimeout (function () {
F.location= "Http://www.111cn.net";
}, 600);
var g=window.open ();
settimeout (function () {
G.location= "Http://www.111cn.net";
}, 700);
var h=window.open ();
settimeout (function () {
H.location= "Http://www.111cn.net";
}, 800);
var i=window.open ();
settimeout (function () {
I.location= "Http://www.111cn.net";
}, 900);
var j=window.open ();
settimeout (function () {
J.location= "Http://www.111cn.net";
}, 1000);
Method Three
var a = $ ("<a href= ' http://www.111cn.net ' target= ' _blank ' >Apple</a>"). Get (0);
var e = document.createevent (' mouseevents ');
E.initevent (' Click ', True, true);
A.dispatchevent (e);
var a = $ ("<a href= ' http://www.111cn.net ' target= ' _blank ' >Apple</a>"). Get (0);
var e = document.createevent (' mouseevents ');
E.initevent (' Click ', True, true);
A.dispatchevent (e);
}
);
-->
</script>
<body></body> |