Current usage of moment.js involves using document.write to add the below javascript to the page:
<script>\ndocument.write(moment(\"%s\").%s);\n</script>
However calling document.write() on a closed document stream (i.e. after page is loaded) automatically calls document.open(), which will clear the DOM (source) and results in pages only displaying the result of the moment.js script above when using jQuery Mobile's AJAX page loads.
How to reproduce issue:
Go to AmmCon main page
Open graphs using the side panel
Refresh the page (necessary in order to force AJAX page load of index page)
Click on the link to go back to the main page
When page is overwritten:
When page loads correctly:
Current usage of moment.js involves using document.write to add the below javascript to the page:
<script>\ndocument.write(moment(\"%s\").%s);\n</script>
However calling document.write() on a closed document stream (i.e. after page is loaded) automatically calls document.open(), which will clear the DOM (source) and results in pages only displaying the result of the moment.js script above when using jQuery Mobile's AJAX page loads.
How to reproduce issue:
When page is overwritten: When page loads correctly: