Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Window 1

Status
Not open for further replies.

Soti

Programmer
Jul 9, 2001
34
US
Is there anyway to set the background and font color for a new window (not opening a new url). Seems like a simple question but I can't find the answer anywhere!
Thanks!
 
Sorry I am a little confused are you creating the html on the fly or are you opening an exsisting html page?

Roj
 
I am creating the page on the fly with:
var display = window.open('', 'NewWin');
I would like to control the bg color on that page. Is there a way to do this?
 
Yes,
All you should have to do is add the bgcolor tag in your script.

var display = window.open('','NewWin');
display.document.write(&quot;<html>&quot;);
display.document.write(&quot;<body bgcolor=purple>&quot;);

that should get you what you want.

Roj
 
For some reason that's not working at all, after adding the code the new window is not opening at all. Anyone know why?
here is the code:
var display = window.open('', 'NewWin');
display.document.write(&quot;<html>&quot;);
display.document.write(&quot;<body bgcolor=&quot;#ffffcc&quot;>&quot;);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top