- This topic has 2 replies, 2 voices, and was last updated 11 years, 10 months ago by alonso100.
-
AuthorPosts
-
alonso100Memberhello,
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.
support-michaelKeymasterInteresting problem. I don’t know what could be goofed.
Can you post an example that replicates the problem for us investigate?
alonso100MemberClose this thread. Either my Mobione played a joke on me or this problem was a consequence of the bug that I found yesterday.
-
AuthorPosts