JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 19th, 2006, 07:49 AM
gsoper gsoper is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 178 gsoper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 8 sec
Reputation Power: 10
Angry Node cannot be inserted at the specified point in the hierarchy

Hi,
can someone point out the error in my ways with the script at http://www.alphaworks.co.uk/test/add2.html ?

It gives a "Node cannot be inserted at the specified point in the hierarchy" error relating to line 26.

I can't see what I'm doing wrong, it would seem a valid thing to do. I've searched on the error but can't see anything which applies to my problem.

Thanks,
Geoff

Reply With Quote
  #2  
Old February 19th, 2006, 09:16 AM
jerom jerom is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Posts: 1,014 jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 21 h 56 m 52 sec
Reputation Power: 14
Look carefully at your newTD function. What are you creating and returning from there? Oops!

Hope this helps,
Jeroen

Reply With Quote
  #3  
Old February 19th, 2006, 10:14 AM
jsKid's Avatar
jsKid jsKid is offline
Application is what Divides Us
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Dec 2002
Location: Titusville, FL
Posts: 2,179 jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level)jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level)jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level)jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level)jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level)jsKid User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 15 h 42 m 16 sec
Reputation Power: 57
Send a message via AIM to jsKid Send a message via MSN to jsKid
MySpace
It may be because the parentNode is not what think.
Code:
// This is what the browser assumes as the table hierachy
// even if you don't include the thead, tbody, or tfoot tags
<table>
  <thead>
    <tr><th></th></tr>
  </thead>
  <tbody>
    <tr><td></td></tr>
  </tbody>
  <tfoot>
    <tr><th></th></tr>
  </tfoot>
</table>


Add ... I'm pretty sure you're going to get TBODY.
Code:
window.alert(insert_press_before_here.parentNode.tagName);
__________________
Download [ Fx | Op ] Validate [ Markup | Css ]

Reply With Quote
  #4  
Old February 23rd, 2006, 04:10 PM
gsoper gsoper is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 178 gsoper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 8 sec
Reputation Power: 10
Quote:
Originally Posted by jerom
Look carefully at your newTD function. What are you creating and returning from there? Oops!

Hope this helps,
Jeroen


Very helpful, silly mistake!

Thanks

Reply With Quote
  #5  
Old February 23rd, 2006, 04:11 PM
gsoper gsoper is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 178 gsoper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 8 sec
Reputation Power: 10
Quote:
Originally Posted by jsKid
It may be because the parentNode is not what think.
Code:
// This is what the browser assumes as the table hierachy
// even if you don't include the thead, tbody, or tfoot tags
<table>
  <thead>
    <tr><th></th></tr>
  </thead>
  <tbody>
    <tr><td></td></tr>
  </tbody>
  <tfoot>
    <tr><th></th></tr>
  </tfoot>
</table>


Add ... I'm pretty sure you're going to get TBODY.
Code:
window.alert(insert_press_before_here.parentNode.tagName);


Hi,
while you're right about the parentNode of the <tr> element being <tbody> and not <table> I don't think this actually caused the problem in this case. I have changed the names of the variables to match this though.

Thanks,
Geoff

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Node cannot be inserted at the specified point in the hierarchy

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap