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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing 1

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I am a newbie with javascript and I am struggling with the syntax. I write mostly PERL and I am finding javascript quite a challenge. I am used to OOP but the references within Javascript have me confused.
I have created a window with window open.
I want to make the background colour of the new window, the same colour as a cell in the old window.
I have looked into the 'opener' function but have yet to find a reasonable explanation of the syntax.
I need something like
Code:
document.bgcolor=window.opener.[coloured cell name].value
this of course is only a guess at the correct syntax.

I have tried many similar options but I am struggling.
Would someone please help.


Keith
 
Should I be able to assign the bgcolor like this?
Code:
<td name="picbox" bgcolor=window.opener.bculler width="50%">
Or does it have to be assigned directly?

Keith
 
It has to be assigned directly.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Are curly braces not always required around 'if' constructs, they look a little odd without them

The braces are needed when you want to use more than one line to write your code. When you only have one action to write in a if..then..else clause, the above syntax is a little easier to code.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top