473,569 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7622
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="javascrip t: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*******@digi shop.de> wrote in message
news:64******** *************** ***@posting.goo gle.com...
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*****@agrico reunited.com> wrote in message news:<3F******* ********@agrico reunited.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="javascrip t:;" onclick="javasc ript:window.ope n(...)">

to

<a href="noJS.html " onclick="window .open(...);retu rn 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(...);retu rn
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(...);retu rn false;">

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

--
| Grant Wagner <gw*****@agrico reunited.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
2016
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 fine, but the images aren't displayed, instead the alt text is shown. The images come up after you "Mouse Over" them but not before......can anybody...
19
4598
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. When i click on a thumbnail or a picture, a larger picture pops up in a javascript window. But it has a space on the top and on the left of my larger...
5
2231
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 difficult. I was thinking of converting the pages to use JavaScript but I know virtually no JavaScript and just wanted to check if what I want to...
1
3739
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
8926
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 problem is, when the javascript fires on the txtDateRequiredOut TextBox in IE, I get "Error on Page" in the status bar and the error says: "Object...
3
11843
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 web page.the js code for dragging around webpage is given below <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD>...
8
6155
by: rajesh | last post by:
< script language = javascript c =...
10
7285
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. Please help me. Here is the php code: function print_rezBilet($rezBilet,$posRezBilet1){ $step=$_SESSION; $max=$_SESSION; $curr=...
5
2926
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 works fine in FF and IE. It's Chrome I'm having issues with. I understand that Chrome is still somewhat in beta stages, so some bugs might occur....
3
3897
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 javascript windows to say the field is not keyed into properly. However, when i convert this html(with javascript inside) into perl script, the perl script...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
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 we have to send another system
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.