I’m trying to write a function that in each call open a new window. Actually it makes the first window and when I call the function again it dont open a new popup, it reload the first one:
function openNewWindow(title, url){
var newWindow = window.open('about:blank', '',
'toolbar=0, status=0, scrollbars=1, width=500, height=500');
var html = '<html><head><title>'+title+'</title></head>'
+ '<body><iframe src="'+url+'" width="100%" height="100%"></iframe>'
+ '</body></html>';
newWindow.document.write(html);
newWindow.document.close();
}
I have tried to store the new window reference in an array, but it dont works as expected. I cant use any library like jQuery. Do you know any way to achieve this?
Thanks!
Use
_blankas window-name(2nd parameter foropen())