Connecting Tech Pros Worldwide Help | Site Map

Table DOM in Mozilla Vs. IE.

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 27th, 2008, 12:38 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Age: 25
Posts: 2,432
Default Table DOM in Mozilla Vs. IE.

Have a look at my code snippet ...
Expand|Select|Wrap|Line Numbers
  1. function add_row(){
  2.  var tr = some_reference;
  3.  document.getElementById('tab_id').appendChild(tr);
  4. }
  5.  
Expand|Select|Wrap|Line Numbers
  1. <table id=tab_id>
  2. <tr id=tr_id>....</tr>
  3. .....
  4. </table>
  5.  
It works in Mozilla but not in IE.
If i do
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('tr_id').parentNode.appendChild(tr);
,
now it works in both :-)
Could you explain why this happens ..experts ?
Reply
  #2  
Old August 27th, 2008, 12:57 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,257
Default

In IE, you need to append to the tbody rather than the table. See this part-article.
Reply
  #3  
Old August 27th, 2008, 12:59 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Age: 25
Posts: 2,432
Default

Quote:
Originally Posted by acoder
In IE, you need to append to the tbody rather than the table. See this part-article.
Yeah i know that's why i knocked the experts ;)
One more thing now a days are you busy ? I thrown a discussion over the core topics ..functions and objects, you didn't take part in that
i expected you to throw something ...... ;)
Reply
  #4  
Old August 28th, 2008, 09:51 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,257
Default

I did see that thread, but didn't participate in it. Some of the concepts I needed to figure out for myself before I could contribute, but I think it's resolved now.
Reply
  #5  
Old August 28th, 2008, 12:00 PM
dmjpro's Avatar
Lives Here
 
Join Date: Jan 2007
Location: India (West-Bengal)
Age: 25
Posts: 2,432
Default

Quote:
Originally Posted by acoder
I did see that thread, but didn't participate in it. Some of the concepts I needed to figure out for myself before I could contribute, but I think it's resolved now.
Oh ...Sure man.
yeah it's now got figured out .....for myself ...
really thanks to Bytes.com experts team from here i came 2 know lot of details ..Java as well as JavaScript ;)

Basically i am also interested in C and C++ which are my heart ;) ...but i could not find out time to take part in those discussions ....
A lot of pressure in my work ...;(
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.