473,503 Members | 9,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pop up URL based on image map ... return false for the main window

hi all,

i am using an image which has image map and i provide the href action
url. i have provided the url to open a pop up window like
"javascript:window.open('www.google.com');" but on clicking the image,
the page (main window) gets refreshed in the background the pop up
opens as desired.

is there a way to cancel the refreshing of page ? i tried

"javascript:window.open(www.google.com); return false;" gives error
so itried
"javascript:new function() { window.open(www.google.com); return
false; }"
but that didn stop refreshing the page either.

i also tried adding onclick function and then return false from there
but in that case the map does not work (no pop up) and i dont get the
required details from the image area.

how do i achieve this ?

thanks & regards
amey

Mar 1 '07 #1
4 5150
ameyas wrote on 01 mrt 2007 in comp.lang.javascript:
"javascript:window.open(www.google.com); return false;" gives error
window.open expects a string for an url,
litteral strings need to be deliminated by quotes in javascript,
and needs http://:

<a
href="javascript:window.open('http://www.google.com'); return false;"
>G...</a>
Better, because not everyone has javascript active, is:

<a
href='http://www.google.com/' target='_blank'
onclick="window.open(this.href); return false;"
>G...</a>
and in this sparse case, you would not need any javascript anyway:

<a
href='http://www.google.com/' target='_blank'
>G...</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 1 '07 #2

thanks evertjan

it ain that straightforward. i am acutally using jfreechart (java
library) to generate chart images. i need to pass string as argument
which is used as prefix in generating maps for that chart.
so i wanted to know if is there any way where by i can cancel the
refreshing.

i do not have a href anywhere.
its all handled internally by jfreechart to generate map. all i can do
is pass some javascript statement within the string.

so target _blank should not work in my case.
all i have is access to img tag which uses auto-generated map. and
string URL which can contain javascript statements like
javascript:window.open(); ..... return false etc.
this string i pass as parameter to jfreechart APIs to generate image
map.

hope i made myself clear :)

thanks & regards
amey
On Mar 1, 6:57 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
ameyas wrote on 01 mrt 2007 in comp.lang.javascript:
"javascript:window.open(www.google.com);return false;" gives error

window.open expects a string for an url,
litteral strings need to be deliminated by quotes in javascript,
and needs http://:

<a
href="javascript:window.open('http://www.google.com');return false;"
G...</a>

Better, because not everyone has javascript active, is:

<a
href='http://www.google.com/'target='_blank'
onclick="window.open(this.href); return false;"
G...</a>

and in this sparse case, you would not need any javascript anyway:

<a
href='http://www.google.com/'target='_blank'
G...</a>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Mar 1 '07 #3
ASM
ameyas a écrit :
thanks evertjan

it ain that straightforward. i am acutally using jfreechart (java
library)
where can we see this curiosity (in action) ?
to generate chart images. i need to pass string as argument
which is used as prefix in generating maps for that chart.
so i wanted to know if is there any way where by i can cancel the
refreshing.

i do not have a href anywhere.
you have certainly one href (and more) !
if not, why to create a map ?
its all handled internally by jfreechart to generate map. all i can do
is pass some javascript statement within the string.
What is this tool that can do almost nothing ?
Of course you have no NotePad or similar ?
hope i made myself clear :)
Hope you can code at home with your NotePad to correct what your java
tool can't make.

Any way Evertjan has given you what to type :
><a
href="javascript:window.open('http://www.google.com');return false;"
with your java tool when it asks url :

javascript:window.open('http://www.google.com');return false;

the real url is between '

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 1 '07 #4

Hi ASM,

jfreechart (http://www.jfree.org/jfreechart) is not a tool, its an
opensource java library (not an editor) to generate chart images
dynamically based on some data. it supports drill down of charts using
image maps so based on where you clicked on the chart, you can further
drill down the chart with selected info.

now it takes URL as the parameter and it automatically appends the
parameters based on the image map.
for ex if you have a yearly bar chart to show sales in 12 months, and
when the user clicks on one particular month, the selected month will
be appended to the URL prefix (which i provide).

now here i can only pass string URL prefix. but i can pass URL
something like
"javascript:window.open('http://localhost:8080/myServlet');"
this will hit the given URL and append the selected month as parameter

now i wanted to know if is there any statement (return false din work)
which can stop refreshing the background page?
event.cancelBubble = true din work as well.
thanks & regards
amey
On Mar 1, 8:18 pm, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
ameyas a écrit :
thanks evertjan
it ain that straightforward. i am acutally using jfreechart (java
library)

where can we see this curiosity (in action) ?
to generate chart images. i need to pass string as argument
which is used as prefix in generating maps for that chart.
so i wanted to know if is there any way where by i can cancel the
refreshing.
i do not have a href anywhere.

you have certainly one href (and more) !
if not, why to create a map ?
its all handled internally by jfreechart to generate map. all i can do
is pass some javascript statement within the string.

What is this tool that can do almost nothing ?
Of course you have no NotePad or similar ?
hope i made myself clear :)

Hope you can code at home with your NotePad to correct what your java
tool can't make.

Any way Evertjan has given you what to type :
<a
href="javascript:window.open('http://www.google.com');returnfalse;"

with your java tool when it asks url :

javascript:window.open('http://www.google.com');returnfalse;

the real url is between '

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date

Mar 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4272
by: Rick | last post by:
I have a script of rolling images. I would like it so that each time an image changes in cell1 some text in cell2 changes. How can this be done. <html> <head> <title>TITLE</title>
2
2355
by: Mekon | last post by:
I have never written a line of script in my life but I need some help with it now. I have this auto generated code which I want to modify if possible The script generates a strip of...
2
9141
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
8
2388
by: Michael Satterwhite | last post by:
I'm opening a page that has a single image on it. I'd like to resize the window containing the image to the size of the image (slightly larger OK, not smaller). The width isn't a problem, but the...
6
2934
by: anonymous | last post by:
hi all, I'm trying to use the capCreateCaptureWindow (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_capcreatecapturewindow.asp) in a Windows...
11
2852
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
4
2694
by: yatin | last post by:
hi, friend. i have a problem in image validation plz check it. i have to include a image validation in foam 1. but i sending a details through form2. But when i include a image validation in foam1,...
1
3778
by: rsteph | last post by:
I bought a book to help me learn to use DirectX with windows programming. It's first trying to walk me through some basic windows programming and graphics before getting into DirectX. I'm trying to...
15
4012
by: javelin | last post by:
I need to be able to create a javascript based drawing/signature box, and be able to save it. Can someone refer me to a script that will allow this, or even a 3rd party package for sale? It can't...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.