Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: NotFoundError

  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts

    NotFoundError

    Anyone with idea why I get not found ?

    Code:
     var rightElement = document.getElementById(rightUUID);
     var leftElement = document.getElementById(leftUUID);
     alert(leftElement);//--> [ObjectHTMLSpanElement]
    
     var range = document.createRange();
     range.setStartAfter(leftElement); 
     range.setEndBefore(rightElement); 
     var sel = window.getSelection();
     sel.removeAllRanges();
     sel.addRange(range);
    
     document.body.removeChild(rightElement);//-->No error
     document.body.removeChild(leftElement);//-->NotFoundError: Node was not found
    Last edited by BubikolRamios; 12-07-2012 at 03:55 AM.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    Can you show it live in a page?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    under construction on local host with ton of code around ...will do sample ......
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    thanks...hard to reproduce that without knowing what you started from.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    Sample: http://agrozoo.net/test/test5.html

    See firebug error console, also the added spans does not disapear (inspecting with firebug), should they ? I mean, plan is that they should.

    EDIT: They don't disapear coz of error, doh strange as document.getElementById(.. finds them (hence I think DOM refresh or something would not help).
    Last edited by BubikolRamios; 12-07-2012 at 03:49 AM.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #6
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    ahh, yes:

    Code:
        rightElement.parentNode.removeChild(rightElement);
        leftElement.parentNode.removeChild(leftElement);
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #7
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,664
    Thanks
    80
    Thanked 4,643 Times in 4,605 Posts
    Elegant fix!
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •