Changing the bgcolor of a Javascript window?

Morgan19

Registered
I'd like to change the color of a Javascript window that pops up when you click on a link, but for the life of me can't figure out how to code it. This is what I've got in the head:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=820,height=350,left = 240,top = 358');");
}
// End -->
</script>

I want the background of that window to be #FFFFCC, so what would I need to add to have it display that color when the window comes up?

m19
 
Hi - presuming you know enough about code to follow this. If you're using DreamWeaver, do you know how to edit the code? If so, this should help.

The way your JavaScript is written, the popUp(URL) function requires a page to be specified in the link that calls the function, for example:

<a href="javascript:popUp('newpage.html')">popup</a>

where 'newpage.html' is the separate html page you want to appear as the popup.

1. create the above link in your original page.

2. create a new page called (for this example) 'newpage.html'.

3. Specify its background colour within the 'body' tag (best to use CSS like this):
<body style="background:#ffc">

Now, when you click the 'popup' link on the original page, it will show your new popup page with the background colour you've specified.

BTW, do you know what you want the below bit to do:
day = new Date();
id = day.getTime();
?
 
Back
Top