使用window.location = "otherpage.html"
切换页面时出现白页,且只在移动端出现,桌面端不出现。
有解决办法吗?
原来我已经禁用了jquery手机的ajax加载使用data-ajax="false"
和直接使用window.location = "otherpage.html"
。这将导致整个页面被完全重新加载,因此我们可以在加载过程中看到一个白屏。
正确的方法应该是
$.mobile.pageContainer.pagecontainer("change", "target", { options });
参考:如何在jQuery移动版(1.4测试版)中更改页面?