473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Opening a image in a new window

Hi

I have small thumbnail pics on my site - I want the client to click on them
and then a new window will open without the toolbar and menu and the other
stuff - displaying just the enlarged image. Can somebody help me to do this
I just cant seem to get it right

Kind Regards
Ria
Jul 23 '05 #1
9 1672

"Ria Van Heerden" <K7*@matrix.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:2g************@uni-berlin.de...
Hi

I have small thumbnail pics on my site - I want the client to click on them and then a new window will open without the toolbar and menu and the other
stuff - displaying just the enlarged image. Can somebody help me to do this I just cant seem to get it right

Kind Regards
Ria

http://devedge.netscape.com/library/...w.html#1202731
here is described how to open new window
your link should be look like <a href="javascript:whatever_function()"><img
scr="your_thumbnail"></a>
Jul 23 '05 #2
Dennis Biletsky wrote:
<snip>
your link should be look like <a
href="javascript:whatever_function()"> [...]


The word "should" and the use of a javascript HREF (where an onckick
handler could be used, with fall-back for the javascript
disabled/incapable of linking directly to the image) should not appear
together in the same statement.

<URL: http://jibbering.com/faq/#FAQ4_24 >

Richard.
Jul 23 '05 #3
Ria Van Heerden wrote:
I have small thumbnail pics on my site - I want the client to click
on them and then a new window will open without the toolbar and menu
and the other stuff - displaying just the enlarged image. Can
somebody help me to do this I just cant seem to get it right


Given the growing popularity of pop-up blocking, do you really need a
new window. Look at:-

<URL: http://www.litotes.demon.co.uk/examp...age_popup.html >

Richard.
Jul 23 '05 #4

"Richard Cornford" <Ri*****@litotes.demon.co.uk> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:c7*******************@news.demon.co.uk...
Dennis Biletsky wrote:
<snip>
your link should be look like <a
href="javascript:whatever_function()"> [...]


The word "should" and the use of a javascript HREF (where an onckick
handler could be used, with fall-back for the javascript
disabled/incapable of linking directly to the image) should not appear
together in the same statement.

<URL: http://jibbering.com/faq/#FAQ4_24 >

Richard.

If javascript has been disabled, the new window couldn't be open by
javascript (like this newwin=window.open()). So in this case the only link
like this will work <a href="your_file.html" TARGET="new_name"><img
src=....... , but in this case will be open default window with menu and
tool bars. Otherwise we need new window without toolbar and menubar. So,
only javascript can help in this case.
Jul 23 '05 #5
Dennis Biletsky wrote:
"Richard Cornford" <Ri*****@litotes.demon.co.uk> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:c7*******************@news.demon.co.uk...
Dennis Biletsky wrote:
<snip>
your link should be look like <a
href="javascript:whatever_function()"> [...]


The word "should" and the use of a javascript HREF (where an onckick
handler could be used, with fall-back for the javascript
disabled/incapable of linking directly to the image) should not appear
together in the same statement.

<URL: http://jibbering.com/faq/#FAQ4_24 >

Richard.


If javascript has been disabled, the new window couldn't be open by
javascript (like this newwin=window.open()). So in this case the only link
like this will work <a href="your_file.html" TARGET="new_name"><img
src=....... , but in this case will be open default window with menu and
tool bars. Otherwise we need new window without toolbar and menubar. So,
only javascript can help in this case.


The point Richard was trying to make, which the FAQ entry he alluded to
explains, is that href="javascript: is a BAD practice.

<a href="imageName.jpg" target="blank"
onclick="window.open(this.href,'','properties here');return false"><img
src="thumbnail.jpg" border="0".....></a>

Then, when JS is enabled, and allows it, the window can be opened as you
want it. If JS is disabled, then the viewer can at least still see/use
the page.

The problem with the entire approach is when the user is using a popup
blocker that redefines the window.open call, then the user gets no
popup, it gets no new window, they get no image. They have an utterly
broken link.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #6
Randy Webb <hi************@aol.com> writes:

Just to be a pedant:
<a href="imageName.jpg" target="blank"
I think you mean "_blank" :)
onclick="window.open(this.href,'','properties here');return

^^ why not: this.target

Otherwise I completely agree.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #7
Lasse Reichstein Nielsen wrote:
Randy Webb <hi************@aol.com> writes:

Just to be a pedant:

<a href="imageName.jpg" target="blank"

I think you mean "_blank" :)

onclick="window.open(this.href,'','properties here');return


^^ why not: this.target

Yes, it should be _blank, I can only claim my medication for my surgery
two weeks ago as my defense. And this.target as a window name has its
appeal.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #8

"Randy Webb" <hi************@aol.com> ???????/???????? ? ???????? ?????????:
news:E9********************@comcast.com...
Dennis Biletsky wrote:
"Richard Cornford" <Ri*****@litotes.demon.co.uk> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:c7*******************@news.demon.co.uk...
Dennis Biletsky wrote:
<snip>

your link should be look like <a
href="javascript:whatever_function()"> [...]

The word "should" and the use of a javascript HREF (where an onckick
handler could be used, with fall-back for the javascript
disabled/incapable of linking directly to the image) should not appear
together in the same statement.

<URL: http://jibbering.com/faq/#FAQ4_24 >

Richard.
If javascript has been disabled, the new window couldn't be open by
javascript (like this newwin=window.open()). So in this case the only link like this will work <a href="your_file.html" TARGET="new_name"><img
src=....... , but in this case will be open default window with menu and
tool bars. Otherwise we need new window without toolbar and menubar. So,
only javascript can help in this case.


The point Richard was trying to make, which the FAQ entry he alluded to
explains, is that href="javascript: is a BAD practice.

<a href="imageName.jpg" target="blank"
onclick="window.open(this.href,'','properties here');return false"><img
src="thumbnail.jpg" border="0".....></a>

Then, when JS is enabled, and allows it, the window can be opened as you
want it. If JS is disabled, then the viewer can at least still see/use
the page.


Yes, it works very well. I'm going to read FAQs again more attentively :)
The problem with the entire approach is when the user is using a popup
blocker that redefines the window.open call, then the user gets no
popup, it gets no new window, they get no image. They have an utterly
broken link.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 23 '05 #9
Dennis Biletsky wrote:

<--snip-->
Yes, it works very well. I'm going to read FAQs again more attentively :)


Pay special attention to section 2.3, paragraph6, with regards to
trimming quotes.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #10

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

Similar topics

2
by: MM | last post by:
I am using the following code to display an image in a seperate window. <form> <input type=button onClick='window.open("image1.jpg","","width=260,height=260,resizable=0,border=0")' value=Shhow...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
2
by: sjp | last post by:
I need to open new windows only for the purpose of viewing linked images, maybe a dozen or so throughout the site. Using the Target="blank" command is quick, easy and seems like the best way to...
10
by: Madame Blablavatsky | last post by:
hello, i have a few links on a page. when one clicks a link an pop up window with an image opens. when people click an other link i want the already availible pop up window to close before the...
3
by: MarkW | last post by:
Hi, I have a Javascript heavy application that I need to record stats from for each click that the user makes. For all intents and purposes this is a shopping cart application that employs a...
5
by: REB | last post by:
Can someone help me with adding some javascript functionality to a button? What would the proper syntax for for (please help with the javascript I am rusty) for doing this: ...
2
by: Keshav Gadia | last post by:
Hi, I am an ASP.net newbie. I am writing a user control that is made up of datagrid with one of the columns opening a new window to display some details on click of the set image. I have...
1
by: Zeroed | last post by:
Hi folks, I've using a call to a standard piece of JavaScript that open a new window with a given URL. In my case, I'm opening an image and have specified the actual size of the image as the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.