/    Sign up×
Community /Pin to ProfileBookmark

JS onClick event for popup won’t work in IE

Hey everybody…

Real simple one here, but I’m not that great at JS. All I want is for my onClick event for some custom html popups to work in IE. It all works fine in FF and Safari. They’re just plain ol’ image maps from Dreamweaver

The code is below. Thanks in advance.

<SCRIPT language=JavaScript>
<!–
function popup(mylink, null)
{
if (! window.open)return true;
var href;
if (typeof(mylink) == ‘string’)
href=mylink;
else
href=mylink.href;
window.open(href, windowname, ‘toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,directories=0,width=300,height=300,left = 490,top = 362’);
return false;
}
//–>
</SCRIPT>

</head>

<body>
<div align=”center”>
<img src=”../Living Spaces/Root/images/Exterior-MAIN.jpg” width=”645″ height=”432″ border=”0″ usemap=”#Map” />

<map name=”Map” id=”Map”><area shape=”rect” coords=”494,64,625,89″ href=”Living Spaces/Root/Popups/popup-AMR.html” target=”_blank” alt=”” onClick=”return popup(this, ‘Atlantic Metal Roofing’)”/>

<area shape=”rect” coords=”225,73,361,101″ href=”Living Spaces/Root/Popups/popup-TAWoods-Solar.html” target=”_blank” alt=”” onClick=”popup(this, ‘T.A. Woods Solar Heating)”/>

<area shape=”rect” coords=”36,73,171,99″ href=”Living Spaces/Root/Popups/popup-Rogers-storage.html” target=”_blank” alt=”” onClick=”return popup(this, ‘Rogers Portable Storage’)”/>

<area shape=”rect” coords=”260,265,365,292″ href=”Living Spaces/Root/Popups/popup-TAWoods.html” target=”_blank” alt=”” onClick=”return popup(this, ‘T.A. Woods Heating & Air’)”/>

<area shape=”rect” coords=”155,334,264,361″ href=”Living Spaces/Root/Popups/popup-Holmes Security.html” target=”_blank” alt=”” onClick=”return popup(this, ‘Holmes Electric Security’)”/>

</map></div>
</body>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@EasyTechAug 14.2009 — Try URL encoding the links. ( no spaces).

Holmes%20Electric%20Security e.g.

JavaScript can do this for you automatically.
×

Success!

Help @beahuman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...