I'm trying to change the page programatically. This first line of code is working, but I don't need it to be delayed, so I tried the second line, but it's not working. What am I missing?
Working (but I don't want the delay):
setTimeout(function () {
$(':mobile-pagecontainer').pagecontainer('change', '#pageId', { changeHash: false });
}, 1000);
Not working:
$(':mobile-pagecontainer').pagecontainer('change', '#pageId', { changeHash: false });
I'm calling it in the <head>
of the document, nested in a "web app tester":
<script type="text/javascript">
if (("standalone" in window.navigator) && !window.navigator.standalone){
//is standalone capable, but not in standalone mode
} else if (("standalone" in window.navigator) && window.navigator.standalone){
//is standalone capable, in standalone mode
} else {
//standalone mode not supported, ie. Desktop.
//doesnt work:
$(':mobile-pagecontainer').pagecontainer('change', '#pageId', { changeHash: false });
//does work, but I don't want the delay:
setTimeout(function () {
$(':mobile-pagecontainer').pagecontainer('change', '#pageId', { changeHash: false });
}, 1000);
}
</script>