Hi
I want to create a window and give it a File.js.
---SomeFile.js------------------------------------------
var NewWindow;
NewWindow = window.open("","_blank");
var AuxVar=NewWindow.document.createElement("script");
AuxVar.language="JavaScript";
AuxVar.type="text/javascript";
AuxVar.src="NewWindow.js";
NewWindow.document.body.appendChild(AuxVar);
--------------------------------------------------------
---NewWindow.js-----------------------------------------
document.body.style.backgroundColor = "#FFFF00";
--------------------------------------------------------
This is just for test but the background of the NewWindow
should change to #FFFF00(yellow) but it doesnt i tryed to
do call "document.recalc("true");" but still doesnt work.
Please help and thanks for all the help you can give.
Comments
If you want to change the background of the popup windiw you should address the document of that window, not the document of the current window:
[code]
NewWindow.document.body.style.backgroundColor = "#FFFF00";
[/code]
: Hi
:
: I want to create a window and give it a File.js.
:
: ---SomeFile.js------------------------------------------
: var NewWindow;
:
: NewWindow = window.open("","_blank");
:
: var AuxVar=NewWindow.document.createElement("script");
: AuxVar.language="JavaScript";
: AuxVar.type="text/javascript";
: AuxVar.src="NewWindow.js";
: NewWindow.document.body.appendChild(AuxVar);
: --------------------------------------------------------
:
: ---NewWindow.js-----------------------------------------
: document.body.style.backgroundColor = "#FFFF00";
: --------------------------------------------------------
:
: This is just for test but the background of the NewWindow
: should change to #FFFF00(yellow) but it doesnt i tryed to
: do call "document.recalc("true");" but still doesnt work.
:
: Please help and thanks for all the help you can give.
:
;-)
-mac-
mailto:mac_doggie@hotmail.com
the Netherlands...
window.open( [sURL] [, sName] [, sFeatures] [, bReplace]);
for placing does things is the 3rd parameter.
Imagine you click a link and the link calls a function with the same
as the SameFile.js it opens a new window but like that the script tag
isnt placed on the document(i have found out how to put it) but if it
was the new window backgroundColor would change to #FFFF00.
Thanks.
: That "_blank" doesn't make enay sense... That paramter is for placing thisngs like scrollbars=YES,width=100,height=200,top=10,left=50 etc...
:
:
: If you want to change the background of the popup windiw you should address the document of that window, not the document of the current window:
:
: [code]
: NewWindow.document.body.style.backgroundColor = "#FFFF00";
: [/code]
:
: : Hi
: :
: : I want to create a window and give it a File.js.
: :
: : ---SomeFile.js------------------------------------------
: : var NewWindow;
: :
: : NewWindow = window.open("","_blank");
: :
: : var AuxVar=NewWindow.document.createElement("script");
: : AuxVar.language="JavaScript";
: : AuxVar.type="text/javascript";
: : AuxVar.src="NewWindow.js";
: : NewWindow.document.body.appendChild(AuxVar);
: : --------------------------------------------------------
: :
: : ---NewWindow.js-----------------------------------------
: : document.body.style.backgroundColor = "#FFFF00";
: : --------------------------------------------------------
: :
: : This is just for test but the background of the NewWindow
: : should change to #FFFF00(yellow) but it doesnt i tryed to
: : do call "document.recalc("true");" but still doesnt work.
: :
: : Please help and thanks for all the help you can give.
: :
:
: ;-)
: -mac-
: mailto:mac_doggie@hotmail.com
: the Netherlands...
:
:
: