Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-06-2006, 06:57 AM   #1
Registered: Nov 2005
Location: India
Distribution: Slackware
Posts: 51

Rep: Reputation: 15
Problem with javascript DOM programming

Hi there

I want to insert a row in a table using Javascript DOM programming. But I get the error mentioned below when I run the below script in Mozilla. Though I am able to appenChild successfully, I am not able to insert the row. If you have any such experience, please help.

<script language="javascript1.2">
function insert()
newText=document.createTextNode("inserted node");
<table border="1" id="mytable">
<td>Td one row one</td>
<td>td two row one</td>
<td>Td one row two</td>
<td>td two row two</td>

<input type=button value="Insert Before" onclick = 'insert()'>

Error: uncaught exception: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "file:///root/LearnDOM/insert2.htm Line: 13"]

In my case line no . 13 is mytable.insertBefore(newTR,oldTR);

Please help me and show me the right direction.
Old 02-07-2006, 06:28 AM   #2
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
I answered a very similar question here on LQ a few days ago. Here's the link:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
javaScript - DOM, djgerbavore Programming 2 03-03-2005 04:44 AM
lookin for a javascript DOM guru... pld Programming 1 02-17-2005 05:14 PM
Java/Javascript problem????? Jadewolf Linux - Software 2 10-25-2003 07:06 PM
Javascript in Linux problem? BajaNick Linux - Software 5 10-20-2003 12:41 PM
Elinks: javascript problem ashesh Linux - General 1 07-21-2003 02:06 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration