Solved

<MAP> tag and Javascript

Posted on 2007-04-04
4
235 Views
Last Modified: 2010-04-16
Hi All

First off thank you for stopping by.

I am doing this charity run website and have a little trouble making <map> tags and fixed target sized window javascript work together. I can get the pop up window. But there is a problem how the main page jumps to a blank page displaying and [object] tag and nothign else.

Here is the secont of the code im trying to work on:

<map name="mr_r8_c15Map">
  <area shape="rect" coords="245,20,349,41" href="javascript:window.open('http://www.milkrun.sg','test','height=150,width=150')">
</map>

here is the link if you would like to see:
www.milkrun.sg/demo

Just click on the Donation Tab on the right.

Any help on this issue would be much appreciated. Thank you very much!

Evan

0
Comment
Question by:siamesefish
  • 2
4 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 18849078
All you need to do is to "return false;"  to kill the anchor move.

Like this:
<map name="mr_r8_c15Map">
  <area shape="rect" coords="245,20,349,41" href="::test" onClick="nw=window.open('http://www.milkrun.sg','test','height=150,width=150');nw.focus();return false;">
</map>


0
 

Author Comment

by:siamesefish
ID: 18849086
That was brilliant! Done perfectly. Thanks a ton! Really appreciate it.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18849089
For the browsers that do not support the onClick (I am no longer sure if there are any left) you may get away with
href="javascript:w=window.open('http://www.milkrun.sg','test','height=150,width=150'); void()"

or

href="javascript:void(window.open('http://www.milkrun.sg','test','height=150,width=150'))"
0
 

Author Comment

by:siamesefish
ID: 18849090
thanks mplungjan! My problem got solved! Appreciate it!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now