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
    2,022
    Thanks
    120
    Thanked 77 Times in 77 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 02: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
    29,411
    Thanks
    85
    Thanked 4,907 Times in 4,868 Posts
    Can you show it live in a page?
    Be yourself. No one else is as qualified.

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    2,022
    Thanks
    120
    Thanked 77 Times in 77 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
    29,411
    Thanks
    85
    Thanked 4,907 Times in 4,868 Posts
    thanks...hard to reproduce that without knowing what you started from.
    Be yourself. No one else is as qualified.

  • #5
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    2,022
    Thanks
    120
    Thanked 77 Times in 77 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 02: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
    2,022
    Thanks
    120
    Thanked 77 Times in 77 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
    29,411
    Thanks
    85
    Thanked 4,907 Times in 4,868 Posts
    Elegant fix!
    Be yourself. No one else is as qualified.


  •  

    Posting Permissions

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