Forum Moderators: open

Message Too Old, No Replies

imagemap works in Firefox, not IE

         

ramseyill

10:51 pm on May 25, 2009 (gmt 0)

10+ Year Member



I've made an imagemap leading to popup windows and while it works fine in Mozilla, the pagge wont even load in IE.

Here is a link- <snip>

Here is the code-

<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=700,height=525,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
</HEAD>

<MAP NAME="park">
<AREA
HREF="camp.html" ALT="Camping"
COORDS="275,404,319,471" SHAPE=RECT
onClick="return popup(this, 'camping')">
<AREA
SHAPE=RECT ALT="villarrica"
COORDS="122,465,297,554" HREF="view1.html"
onClick="return popup(this, 'villarrica')">

<AREA SHAPE=DEFAULT NOHREF>
</MAP>

<img src="thepark.jpg" width="825" height="623" ALT="The park" BORDER="0" USEMAP="#park" />

Any pointers would be vrery helpful! Thank you

[edited by: whoisgregg at 6:28 pm (utc) on May 26, 2009]
[edit reason] Whoops, no URLs please. See TOS [webmasterworld.com] [/edit]

daveVk

2:51 am on May 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make sure overall structure is correct, validate your html


<html>
<head>

<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=700,height=525,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
</HEAD>
<body>
<MAP NAME="park">
<AREA
HREF="camp.html" ALT="Camping"
COORDS="275,404,319,471" SHAPE=RECT
onClick="return popup(this, 'camping')">
<AREA
SHAPE=RECT ALT="villarrica"
COORDS="122,465,297,554" HREF="view1.html"
onClick="return popup(this, 'villarrica')">

<AREA SHAPE=DEFAULT NOHREF>
</MAP>

<img src="thepark.jpg" width="825" height="623" ALT="The park" BORDER="0" USEMAP="#park" />

</body>
</html>

ramseyill

8:20 pm on May 27, 2009 (gmt 0)

10+ Year Member



Well I've tried this now and it doesn't seem to be the problem. Thanks though!

daveVk

12:06 am on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Install the "HTML validater" addon for mozzila. View source will then show issues, and even try to fix them.

enigma1

9:36 am on May 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



works here with IE7 so yes check your entire html that is generated.