Categories: Give Feedback :

Javascript window.opener has no effect on parent window (only Chrome, other browsers ok)

Showing 1-2 of 2 messages
Javascript window.opener has no effect on parent window (only Chrome, other browsers ok) guntis.e 8/25/11 11:47 PM
Google Chrome version
Google Chrome        13.0.782.215 (Oficiālā Uzbūve 97094) m
Operētājsistēma        Windows
WebKit        535.1 (branches/chromium/782@93192)
JavaScript        V8 3.3.10.30

I can't get window.opener working on Chrorme.
Here is the code of parent and child windows. I tested the scripts on IE, FF and Safari latest version - it works

parent.html:
================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="" content="">
</head>
<body>

<a onclick="window.open('child.html', '', 'width=880, height=700, left=100, top=50, scrollbars=yes, resizable=yes');" href="#">Open child</a>

</body>
</html>

child.html
==================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="" content="">
</head>
<body>
<center>
<form>
<input type="button" onClick="window.opener.document.bgColor='yellow'" value="yellow">
<input type="button" onClick="window.opener.document.bgColor='lightgreen'" value="lightgreen">
<input type="button" onClick="window.opener.document.bgColor='white'" value="white">
</form>
</center>
</body>
</html>

Any ideas?
Re: Javascript window.opener has no effect on parent window (only Chrome, other browsers ok) guntis.e 8/28/11 3:39 AM
Thanks to mr Edgars Rasins i found the answer. This doesn't work only if i try it on the local machine. When put on server, everything is ok. This answer satisfies me, as i am not plannign to run this functionality locally.