Solved

<MAP> tag and Javascript

Posted on 2007-04-04
4
234 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 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

13 Experts available now in Live!

Get 1:1 Help Now