1 2 3 4 5 6 7 8 9 10 11 12 13
| //Open an about:blank page in a new window:
var myWindow = window.open("","","width=200,height=100");
//Open a new window called "MsgWindow", and write some text into it:
var myWindow = window.open("","MsgWindow","width=200,height=100");
myWindow.document.write("<p>This is 'MsgWindow'. I am 200px wide and 100px tall!</p>");
//Replace the current window with a new window:
var myWindow = window.open("","_self");
myWindow.document.write("<p>I replaced the current window.</p>");
//Open a new window and control its appearance:
window.open("http://www.w3schools.com","_blank","toolbar=yes, scrollbars=yes, resizable=yes, top=500, left=500, width=400, height=400");
//Open multiple windows:
window.open("http://www.google.com/");
window.open("http://www.w3schools.com/"); |
Partager