View Full Version : DHTML Window Script, Javascript Pass url back to opener problem.

07-31-2006, 04:04 PM
Hi there, i am using a DHTML Window script to open an image map in there. The idea is: after user clicks on certain area on the image map, the appropriate page loads in the "parent" window.
Here is the code that goes inside the DHTML Window:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript">

function selectItem(url){
window.opener.location.href = url;


<img src="images/headend_d.jpg" alt="room_d" border="0" usemap="#map" />
<map name="map" id="map">

<area shape="rect" coords="67,647,89,683"
// Here the problem starts!!!
// When i use onclick, the area on the map is not clickable!

//Here i try it with the href, the area is clickable, but nothing happens

<area shape="rect" coords="91,648,113,682" href="http://www.someadress.com/show.php?id=3" />


Am i doing something wrong?:( Thanks guys!

07-31-2006, 04:20 PM
The DHTML Window isn't really a window. It's an <iframe> inside a <div>. This might work:
function selectItem(url){
parent.location.href = url;

07-31-2006, 04:34 PM
Great it works, even i the iframe is closed by itself.....magic:) thanks