Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6175037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:51:19+00:00 2026-05-23T23:51:19+00:00

I’m using javascript with backbone and adobe air. In my view model, I have

  • 0

I’m using javascript with backbone and adobe air. In my view model, I have a parse function where it saves the response( Dom object ), later on, when user hits saves, I want to add a couple of nodes to that saved response but I’m getting Dom exception 3, any help? Here are some code for reference.

parse: function(resp, xhr){
       this.treeDoc = xhr.responseXML
       //parse routine
      }

Somewhere down the road, when user wants to save

var xmlTree = createMyXML(); //creates a sub xml tree
this.treeDoc.appendChild(xmlTree ); //DOM Error 3 thrown

Any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:51:20+00:00Added an answer on May 23, 2026 at 11:51 pm

    You are likely to have to call adoptNode first:

    this.treeDoc.adoptNode(newElements);
    

    Then append to a child node like:

    this.treeDoc.documentElement.firstChild.appendChild(newElements);
    

    Additionally if newElements is an array of new elements(like the name suggest) you will need to iterate through it.

    See https://developer.mozilla.org/en/DOM/document for more info.

    An answer to your comment(it was to large to be a comment it self):

    Even if I didn’t reproduce the error I think I know why you are getting it. Error 8 is the code for NOT_FOUND_ERR. Guess you save the value of childNodes.length and iterate from 0(zero) to this value, what happens here is that the childNodes array is updated every time a child is added or removed, and then in some point in your loop i is actually greater than childNodes.length(but not greater that the saved value) causing childNodes[i] to return undefined. And because undefined is not a child of the referenced node the NOT_FOUND_ERR (code 8) is throw. To avoid this with minor changes to the code just iterates for the initial value of childNodes.length-1 to 0(zero), or just do:

    while(node.childNodes.length > 0) node.removeChild(node.childNodes[0])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.