I'm trying to create a window and change its properties dynamically.
But when I load a web page (ex : www.google.com) : loads perfectly; and press "Red" button the window moves back and doesn't change its background color.
Here is my code:
JavaScript:
var win1 ='';
function create(){
var url1=document.getElementById('myUrl').value;
win1=open(url1,'hello', 'width=500,height=500');
}
function makeItRed(){
win1.document.body.style.backgroundColor="red";
win1.focus();
}
function closeIt(){
win1.close();
}
HTML:
<input type="text" id="myUrl"/>
<button onClick="create()">Click</button>
<button onClick="makeItRed()">Red</button>
<button onClick="closeIt()">close</button>