Forum Moderators: open

Message Too Old, No Replies

innerHTML in IE

does not show images

         

kadnan

9:04 pm on Jan 20, 2010 (gmt 0)

10+ Year Member




if(xhr.readyState == 4)
{
if(xhr.status == 200)
{
document.getElementById("dtk").innerHTML = "<img src='images/tk.jpg'>";
document.getElementById("dab").innerHTML = "<img src='images/ab.jpg>";
document.getElementById("dgs").innerHTML = "<img src='images/gs.jpg>";
}

}

It sets the innerHTML of first DIV only nd it does not read or set the innerHTML of the rest of the two. I m failed to figure out the reason. Kindly guide

kadnan

9:08 pm on Jan 20, 2010 (gmt 0)

10+ Year Member



I am using IE8

Fotiman

9:11 pm on Jan 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You are missing a single quote at the end of the src attribute for the 2nd and 3rd items. For example:


... "img src='images/ab.jpg>";

Should be:

... "img src='images/ab.jpg'>";

and


... "img src='images/gs.jpg>";

Should be:

... "img src='images/gs.jpg'>";

kadnan

9:26 pm on Jan 20, 2010 (gmt 0)

10+ Year Member



Oh Damn! me sucks!

Thanks a ton pal!

p.s: Should I praise IE8 and Chrome that they did not let me do wrong coding or curse FireFox that it ignored the issue?