- contains two buttons with labels "open window" and "close window", respectively
- open button opens a new window of webpage as many times as it is clicked
- close button closes the last open window whenever it is clicked
var myWindow = null;
function win_open() {
myWindow = window.open("http://www.naver.com/");
}
function win_close() {
if (myWindow != null) myWindow.close('open');
}
Aucun commentaire:
Enregistrer un commentaire