Wrox Programmer Forums
|
BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1
This is the forum to discuss the Wrox book Beginning JavaScript, 3rd Edition by Paul Wilton, Jeremy McPeak; ISBN: 9780470051511
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript 3rd Ed. ISBN: 978-0-470-05151-1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2010, 10:04 AM
Registered User
 
Join Date: Apr 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation can any1 solve window.open() and window.opener issues

I'm doing a lil experiment on window.open to achieve certain result. Its something like when I open exp.htm and click on the link an existing page paintParent.htm should open and it has 1line of text in it. Through exp.htm we are appending one line of text to paintParent.htm. paintParent.htm is changing background color of exp.htm The codes are given below --

exp.htm
--------

<html>
<head>
<script type="text/javascript">

function openNewLink() {

var newwindow = window.open("paintParent.htm","mywindow","width=40 0,height=300");
//newwindow.focus();

newwindow.document.open();
newwindow.document.write("<b>this is exp.htm</b>");
newwindow.document.close();

return false;

}
</script>
</head>

<body>
<p> Click below to open paintParent.htm page and it will also change backcolor of this page to

red</p>

<a href="" onclick = "return openNewLink()">click here</a>
</body>

</html>


paintParent.htm
---------------


<html>
<script type="text/javascript">
//this file will paint exp.htm when that file is opened.

document.write("this is paintParent.htm");
window.opener.document.bgcolor = "RED";

</script>
</html>
 
Old April 1st, 2010, 10:30 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

bgcolor should be spelled as bgColor with captial C:
Code:
<html>
<script type="text/javascript">
//this file will paint exp.htm when that file is opened.

document.write("this is paintParent.htm");
window.opener.document.bgColor = "RED";

</script>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener for mozilla jun99 Javascript 3 September 1st, 2009 08:57 AM
Problem accessing the window.opener.opener maryuob Javascript 3 January 18th, 2006 05:25 AM
window.opener problems crmpicco Javascript How-To 2 September 30th, 2005 03:46 AM
window.opener help fs22 Javascript How-To 6 May 9th, 2004 10:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.