facebook

Problem in version 2.3 in the DOM: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #334101 Reply

    alonso100
    Member

    hello,

    I upgraded today to 2.3 and have a problem with the DOM and a DIV, which I never had before. I create dynamically a DIV when calling a JS function; the div contains several other objects which are created in the same function. When ready, information is displayed as a popup window.

    mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));

    When user closes the popup window I have to remove the DIV from the DOM, which I did so until yesterday:

    document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));

    It is removed indeed but the new phenomenon is that application goes back to the main page, acting like if user had pressed the back button, no matter how many screens in-between, that is, page1 calls page2 which calls page3. When closing the pupup window, it goes to page1. It seems like it makes a refresh to the DOM after removal of the DIV, and this is not good.

    Problem number 2 is that I notice that the code for removing the DIV is executed at least 3 times, so this triggers an exception because, logically, the object does not exist any more (see screenshot). Perhaps this is so because of the refresh of the page.

    Searching in the internet I found this other way for removing the DIV but it also cannot avoid the regeneration of the DOM:

      try{
      node = document.getElementById("modalContainer");
      father = node.parentNode;
      father.removeChild( node );
      } catch(error){
        alert(error.message);
      }

    What has been changed in this new version ?? how can I solve this ??

    Attachments:
    You must be logged in to view attached files.
    #334109 Reply

    support-michael
    Keymaster

    Interesting problem. I don’t know what could be goofed.
    Can you post an example that replicates the problem for us investigate?

    #334162 Reply

    alonso100
    Member

    Close this thread. Either my Mobione played a joke on me or this problem was a consequence of the bug that I found yesterday.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Problem in version 2.3 in the DOM: CLOSED

You must be logged in to post in the forum log in