【发布时间】:2015-06-21 11:15:24
【问题描述】:
javascript:
function changeView(newViewDiv){
window.location.href = "#"+newViewDiv;
}
在我的 javascript 代码的不同位置,我使用此函数浏览不同的 jquery 移动页面 例如:-
<div data-role="page" id="addpage">...</div>
要查看上面的页面,我在我的 js 代码中使用了 changeView('addpage')。 这适用于 chrome、safari、firefox 等,但不适用于 Internet Explorer。浏览器的 url 更改为 http://example.com/index.html#addpage 但页面未显示。有人有这个解决方案吗?
【问题讨论】:
-
何时/如何调用该方法?什么版本的 IE?
-
在 jQuery Mobile 中,您应该使用 pagecontainer 小部件更改方法导航页面:api.jquerymobile.com/pagecontainer/#method-change, $( ":mobile-pagecontainer" ).pagecontainer( "change", "#" + newViewDiv, { transition : "幻灯片" });
标签: javascript internet-explorer jquery-mobile hash