Jump to content


Photo

the code not work with IE 6


  • Please log in to reply
1 reply to this topic

#1 Dooq

Dooq
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 11 April 2006 - 11:06 AM

Hi

this code dosent work with the IE6 but it work with FireFox.

 document.getElementById( 'ShopCart' ).innerHTML = '<tr><td class="sub_cat"><img border="0" src="Image/product_img/product_thump/'+id+'.bng" height="20" width="20">'+document.getElementById( 'name' ).innerHTML+'<br />Q :<span id="quant_'+id+'">1</span></td></tr>'+document.getElementById( 'ShopCart' ).innerHTML;

how can i fix it to work with IE

Thanks

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 20 April 2006 - 12:15 AM

Hi there,

Maybe I've found a start for your anwser,.. not sure,,

I guess I'm right,, but, if "ShopCart" is the Id for your table,...

This code will not work with IE, but work with FF:
<html>
<body>

<table id="ShopCart">testing,,,
</table>

<script>
document.getElementById('ShopCart').innerHTML = '<tr><td ><img border="0" src="image1.jpg"></td></tr>';
</script>
</body>
</html>
But this one will work with both IE & FF:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<html>
<body>

<div id="ShopCart">testing,,,
</div>

<script>
document.getElementById('ShopCart').innerHTML = '<tr><td ><img border="0" src="image1.jpg"></td></tr>';
</script>
</body>
</html>
[/quote]
So, we could say the 'id' property is not running well using the < table > tag with IE,...

Also,... using the innerHTML function, it should remplace the all contents of the element 'ShopCart',... but with both FF & IE, as the "testing,,," word is in a table, & as it is not in a <tr/td> tag, it will be displayed normally,...
To test, this code will remove the "testing,,," word, as it is in a <td> tag,...
<html>
<body>

<table id="ShopCart"><td>testing,,,</td>
</table>

<script>
document.getElementById('ShopCart').innerHTML = '<tr><td ><img border="0" src="image1.jpg"></td></tr>';
</script>
</body>
</html>

Hoping it helps,,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users