EZboy
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:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript">
function selectItem(url){
window.close();
window.opener.location.href = url;
}
</script>
</head>
<body>
<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!
onclick="javascript:selectItem('http://www.someadress.com/show.php?id=2');"
//Here i try it with the href, the area is clickable, but nothing happens
href="javascript:selectItem('http://www.someadress.com/show.php?id=2')"
/>
<area shape="rect" coords="91,648,113,682" href="http://www.someadress.com/show.php?id=3" />
</map>
</body>
</html>
Am i doing something wrong?:( Thanks guys!
Here is the code that goes inside the DHTML Window:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript">
function selectItem(url){
window.close();
window.opener.location.href = url;
}
</script>
</head>
<body>
<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!
onclick="javascript:selectItem('http://www.someadress.com/show.php?id=2');"
//Here i try it with the href, the area is clickable, but nothing happens
href="javascript:selectItem('http://www.someadress.com/show.php?id=2')"
/>
<area shape="rect" coords="91,648,113,682" href="http://www.someadress.com/show.php?id=3" />
</map>
</body>
</html>
Am i doing something wrong?:( Thanks guys!