Solved

<MAP> tag and Javascript

Posted on 2007-04-04
4
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Telerik RadEditor Control Save 8 39
Anchor Bookmark 6 33
powershell script error 2 34
Make qty change inside array as well 1 15
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.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

739 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