473,396 Members | 1,907 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,396 software developers and data experts.

Javascript: Img-Change-Problem with IE

Hello group!

I've a problem with JavaScript and IMG-Objects.
On my webpage I use a big image and several small images. If you click
on a small image, it executes a JavaScript to change the source of the
big image to the source of the small image.

It's working fine, but on some browsers (I use IE 6.0.2800.1106) the
image doesn't change properly.
I click on the image and the big image turns white. Now I have to
click on the image again and sometimes it works and changes the image
(without reloading the site). I've found no logic, why it's working
only sometimes.

If you'd like to test, go to
http://www.nwh.de/odb/index.cfm/fuse...Object/nID/534

In the past I used IE 5.5 and all has worked fine. But after an update
of my browser I've those errors.

Does anybody know a workaround for the problem?

Thanks for the support!

Christian Kusenbach
Jul 20 '05 #1
2 7608
Tell you what I wouldn't do. An anchor by it's nature is meant to be clicked
and therefore has an href property which specifies what is to happen on
clicking the anchor. Therefore unless there are two things you want to
happen on clicking the anchor, don't specify an href property and an onClick
property. Just do

<a href="javascript:changePic('/images/something.gif');"><img
src="something" border="0"></a>

Don't know if this is what is causing you grief, but it's worth fixing this
in the meantime.

Peter.

"Christian Kusenbach" <ku*******@digishop.de> wrote in message
news:64**************************@posting.google.c om...
Hello group!

I've a problem with JavaScript and IMG-Objects.
On my webpage I use a big image and several small images. If you click
on a small image, it executes a JavaScript to change the source of the
big image to the source of the small image.

It's working fine, but on some browsers (I use IE 6.0.2800.1106) the
image doesn't change properly.
I click on the image and the big image turns white. Now I have to
click on the image again and sometimes it works and changes the image
(without reloading the site). I've found no logic, why it's working
only sometimes.

If you'd like to test, go to
http://www.nwh.de/odb/index.cfm/fuse...Object/nID/534

In the past I used IE 5.5 and all has worked fine. But after an update
of my browser I've those errors.

Does anybody know a workaround for the problem?

Thanks for the support!

Christian Kusenbach

Jul 20 '05 #2
Hi Grant!

Thanks a lot for your help!

It seems to work fine now.

Regards,

Christian

Grant Wagner <gw*****@agricoreunited.com> wrote in message news:<3F***************@agricoreunited.com>...
Your problem is the link definition you've used. The problem is described
to some extent at <url: http://jibbering.com/faq/#FAQ4_24 />

Change your links from

<a href="javascript:;" onclick="javascript:window.open(...)">

to

<a href="noJS.html" onclick="window.open(...);return false;">

noJS.html should contain some information about why the link isn't working
for them. If you don't like having your existing page wiped out to explain
to people with JavaScript not enabled you could use:

<a href="noJS.html" target="noJSwin" onclick="window.open(...);return
false;">

if you never intended to support people without JavaScript enabled and
really don't care what happens to them when they click the link you can
use:

<a href="#" onclick="window.open(...);return false;">

In each case, the important part is adding "return false" to the onclick
event.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html

Jul 20 '05 #3

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

Similar topics

10
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load...
19
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site....
5
by: Carl Gilbert | last post by:
Hi I have some ASP code that I want to run from CD within a VB.NET windows application with a web browser control. However, to get the ASP pages to run without a server is proving quite...
1
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
4
by: Greg | last post by:
I'm guessing the problem I'm having has something to do with Master Pages or DetailsView because the exact same code works fine on a page without a Master Page and DetailsView controls. The...
3
by: crazystone82 | last post by:
Hi friends, i need to drag a file from desktop and drop into web page.actually i had did a JS for dragging the images around the web page,but i dont know how to drag the file and drop it into...
8
by: rajesh | last post by:
< script language = javascript c =...
10
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
5
by: Nike1984 | last post by:
I'm fairly new to Javascript and it's more of a guessing game for me... I'm trying to build an app for Google Maps and just had some issues recently. First off I just wanted to say that everything...
3
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.