"Node was not found" - NS_ERROR_DOM_NOT_FOUND_ERR

Discussion in 'JavaScript' started by svangu, Sep 29, 2007.

  1. #1
    Hello to all!

    I need help regarding this script:

    <script type="text/javascript">
    <!--
    var ta=new Array();
    function addTextArea(n, lang, value){
    var remove = document.getElementById('txtara'+n);
    if (remove.hasChildNodes()){
    remove.removeChild(remove.removeChild(ta[n]));
    }
    ta[n]=document.createElement('textarea');
    ta[n].name='straInsert[description_'+lang+']';
    ta[n].setAttribute('rows',7);
    ta[n].setAttribute('cols',70);
    ta[n].setAttribute('wrap','virtual');
    ta[n].value=value;
    document.getElementById('txtara'+n).appendChild(ta[n]);
    }
    //-->
    </script>


    but unfortunately, i become this error:

    Error: uncaught exception: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)"

    The Problem as i understand it, is at line " remove.removeChild(remove.removeChild(ta[n])); "
    Although this error in error console, the script is working smoothly & perfect, but this error is annoying!
    What am i doing wrong? Can you please help me? Any help wil be appreciated!
    Thank you in advance!
     
    svangu, Sep 29, 2007 IP
  2. sdemidko

    sdemidko Member

    Messages:
    81
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #2
    check availability of the each element on that line
     
    sdemidko, Oct 2, 2007 IP
  3. svangu

    svangu Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you for your answer, but this still not help me!
    Each element is available and functional, but i still become this error! The idea is when a person need one more textarea, the script build it, and when not, the script hide it (every time by clicking of the same link). All this is functioning, but the error is still there :confused: :confused: :confused:
     
    svangu, Oct 2, 2007 IP