Javascript Function to reload DOM Element?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Aug 2005
Posts: 75
Reputation: Sailor_Jerry is an unknown quantity at this point 
Solved Threads: 2
Sailor_Jerry's Avatar
Sailor_Jerry Sailor_Jerry is offline Offline
Junior Poster in Training

Javascript Function to reload DOM Element?

 
0
  #1
Apr 6th, 2007
Is there a javascript function that will reload a dom element if given the element id?

I am using javascript to update a divs innerHTML with the location of an image.

Cut of the javascript code below.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var images = new Array(32);
  2. images[0] = "<img src=\"images/album/1.jpg\" />";
  3. images[1] = "<img src=\"images/album/2.jpg\" />";
  4.  
  5. var i = document.getElementById("curPhtImg");
  6. i.innerHTML = images[curImgNum];

This works in firefox, but in ie the window does not repaint with the updated image.
Also if anyone has any other ideas on how i could do this please let me know.

Thanks, sj
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC