Solved

<MAP> tag and Javascript

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery Toggle & Anchor Links 5 43
HTML Anchor Link Problem 3 35
Opening a new tab in IE using Powershell / HTML 2 19
PS call executable Files in Order 4 11
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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 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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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