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

img src change works in FireFox and Safari, but IE not updating images.

I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php.

As the user makes selections, it updates images of various parts, giving them a preview of the finished item. The preview resides within a div and is simply a series of <br>-separated images. Simple html. The system is working fine with FireFox and Safari, but some MSIE 6 and 7 users are reporting that only the first image is updating and the remainder remain static. I've tried several different approaches over the last two weeks, all with the same frustrating results. I figured it is time to ask others for their insights.

The div contains about 20 small images. The MSIE behavior is: When first loaded, the div content USUALLY displays correctly, but when updated, only the topmost image updates and the rest don't change. For other browsers, all images are updating correctly. I can post the javascript if you wish, but it doesn't appear to be the problem (he said ignorantly).

1) My first approach was to completely replace the div content with new <img> tags using innerHTML each time the user makes a change (document.getElementById(divID).innerHTML = newContent). I have confirmed that the html is valid by vetting at the W3C validator and loading it directly into a web browser. Some MSIE users said this wasn't working, so I tried...

2) Leave the html content static after initial filling of the div, updating the src attributes via document.getElementById(imgID).src = newsrcvalue. Each image has a unique id. Some MSIE users said it still wasnt working, so I tried...

3) After reading about MSIE image update problems, and Microsoft notes, tried inserting the <img> tags without any src attribute (<img name="imgName" id="imgID" ...>, then assign the source attribute. Still didn't work, so....

4) Tried falling back to an earlier DOM0 method to update the src attributes, document.images[imageName].src = newsrcvalue. Still no joy. That same method is working (or at least was) on another, earlier web page.

The initial content of the div is appearing properly, and the topmost image is updating, at least once. But the images below it are not updating in MSIE. In other browsers it seems to work fine. I'm not seeing any warning or errors in the logs on FireFox or Safari. The javascript I'm using all appears valid.

Anyone run into this or have any suggestions as to other means of approaching this problem? I really am out of ideas on this one.

Thanks for your thoughts on this.

Seth
Feb 3 '08 #1
5 5320
gits
5,390 Expert Mod 4TB
hi ...

the page-link you gave didn't work with IE6 and had an error ... did you test it with IE? could you trace down to the error ... since it occired in a line 17xx so it is a bunch of lines :) ...

kind regards
Feb 4 '08 #2
hi ...

the page-link you gave didn't work with IE6 and had an error ... did you test it with IE? could you trace down to the error ... since it occired in a line 17xx so it is a bunch of lines :) ...

kind regards
Thanks. I'll look into this. Though FireFox js log is showing no errors, I am having problems with both IE6 and 7 working at all now. I appreciate your comment and will see if I can track down what is choking IE.

Seth
Feb 6 '08 #3
gits
5,390 Expert Mod 4TB
Thanks. I'll look into this. Though FireFox js log is showing no errors, I am having problems with both IE6 and 7 working at all now. I appreciate your comment and will see if I can track down what is choking IE.

Seth
did you change something? the firebug showed the 2 mentioned errors ... actually there are some warnings only that shouldn't stop the code to work. now what particular problem do you have? could you explain it?

kind regards
Feb 6 '08 #4
did you change something? the firebug showed the 2 mentioned errors ... actually there are some warnings only that shouldn't stop the code to work. now what particular problem do you have? could you explain it?

kind regards
Very kind of you to follow up. Thank you.

I pushed the javascript through two different LINT programs for vetting, did a bunch of small tweaks, then downloaded every web browser I could find (that will run on my Mac) and tested, tested, tested. FireFox, Safari, Camino, Opera, etc. No problems until Opera choked on the use of indexOf against an array, and some people reported that MSIE6 and 7 will do the same, so I added a prototype function for Array.indexOf to cover those bases.

The indexOf was in a position that could have caused the problem I originally reported -- it is in the function that updates the preview images that weren't updating properly for MSIE users. At this point everything looks fine from my end -- but it has all along, so I'm waiting for feedback from MSIE6&7 users/testers to see if this change made "the" difference.

I'll follow up once I have an answer.
Feb 7 '08 #5
gits
5,390 Expert Mod 4TB
could you post the code that made the problems? may be we find a simple workaround for it ...

kind regards
Feb 7 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Diane Wilson | last post by:
I'm still working my way through the CSS box model to do tableless layout. Thanks to all here who have helped previously; I'm making progress but still running into issues. This site is *almost*...
4
by: drew197 | last post by:
I am a newbie. I am editing someone elses code to make it compatible with Firefox and Safari. In IE, when you click on the proper link, a block of text is shown in a nice paragraph form. But, in...
12
by: cewisham | last post by:
I have a menu that pops up different layers as you mouse over. Seems to work OK in IE 6. I position the layers dynamically with javascript because the menu moves when users resize their browser...
1
by: pintoamanda | last post by:
Can someone tell me why the following code: <table width="449" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td><img src="images/whitespace.gif" alt="" border="0"><a...
11
victorduwon
by: victorduwon | last post by:
Hey guys, I have built a suckerfish navigation menu using CSS and HTML with unordered lists. I was testing this menu in Safari, and it came out good. When I finished I tested it in firefox and...
3
by: dugald.morrow | last post by:
I have some javascript that updates the text in a text field after certain actions take place such as clicking a checkbox. The javascript works fine in Safari and Firefox, but in IE, the text in...
4
by: PianoMan64 | last post by:
Hey Experts, I'm not sure how to get around this, and any help would be most greatfull. I have an issue with having a CSS menu that displays correctly in IE and not correctly in Firefox 3.0.3,...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.