473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

set bgcolor in window.open or document.write or...

Nat
Hi I have following code:
-----------------
protected override void Render(HtmlTextWriter w)
{
if (helpString!=null)
{
w.Write("<span class='tooltipiconouter'><img title =
'"+this.helpString+"' class='tooltipIconInner' align='center' src =
'../Lib/images/questionmark.gif' a href='#' onclick = 'myWin =
window.open(\"\", \"\", \"width=300, height=200, directories=no\");
myWin.document.write(\"" +helpString+"\");'></a></span>");
}
}
-----------------

Now I want to change the bgcolor in the window that opens, what and
where do I have to write that?

I've tried myWin.document.bgcolor=#333333 but either it doesn't work,
or it is because i'm writting it in a wrong place.

Please help

Nat
Jul 20 '05 #1
1 5023
In article <da**************************@posting.google.com >,
nm@sondagsavisen.dk (Nat) wrote:
Hi I have following code:
-----------------
protected override void Render(HtmlTextWriter w)
{
if (helpString!=null)
{
w.Write("<span class='tooltipiconouter'><img title =
'"+this.helpString+"' class='tooltipIconInner' align='center' src =
'../Lib/images/questionmark.gif' a href='#' onclick = 'myWin =
window.open(\"\", \"\", \"width=300, height=200, directories=no\");
myWin.document.write(\"" +helpString+"\");'></a></span>");
}
}
-----------------

Now I want to change the bgcolor in the window that opens, what and
where do I have to write that?

I've tried myWin.document.bgcolor=#333333 but either it doesn't work,
or it is because i'm writting it in a wrong place.

Please help

Nat


As an alternative, just set the body tag background color. When you
write out the tags to the window.open document write out the normal html
tags like:

var debugWindowName = "My Window";
var newWindow;

newWindow = newWindow = window.open(
"",debugWindowName,"scrollbars=yes,resizable=yes,w idth=700,height=500");
newWindow.document.writeln(
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
newWindow.document.writeln("<html>");
newWindow.document.writeln(
"<header><title>Window " + debugWindowName + "</title></header>");
newWindow.document.writeln(
"<body bgcolor="red">");

Robert
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jawahar Rajan | last post by:
All, I have a printer friendly page that is opened when a user clicks a link on my page to get the printer friendly version, How ever when they close out the printer friendly version and return to...
9
by: Justin Koivisto | last post by:
Is there a way to create an alert-like message box that uses a custom image? Basically, I want to replace the default ! image with something else. -- Justin Koivisto - spam@koivi.com PHP...
2
by: dan | last post by:
This works in mozilla but I can't figure out why this won't work in IE. Say I have this html <html> header goes here header goes here
4
by: Phillip Parr | last post by:
Hello, I have a nice system where someone clicks on a picture to show the full version. This pops up in a window.open box. It works great, the only problem is that if the user clicks a second...
6
by: news.versatel.de | last post by:
Hello NG, I am using javascript to open a new window like this: printpreview=window.open('printview.php','printprev','width=600,height=600'); The new window has a layer called preview: ...
10
by: soup_or_power | last post by:
The pop up window has several checkboxes. I'm unable to access the checkboxes using the handle from window.open. Any way to do this? var display; function showSugg(but_id, sugg1, sugg2, sugg3,...
1
by: Angelos | last post by:
Hello there, I am very new to Javascript and before I explain what I want I'll tell you in a few words that I am trying to make a button on a WYSIWYG text editor (RichArea) that previews on a...
2
by: jackson2005 | last post by:
OK, I need to do three different things. On the ONLOAD event I would like a popup box to open. In this popup box I need two text boxes. One for the UserName and one for the BillingTo name. ...
3
by: kosmodisk | last post by:
Hi, I'm having problem accessing javascript-created elements from opened window. This occurs only when I'm including another files in opened window, javascript or css. When I comment out...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.