问题描述
我正在使用 $("#pagePort").load()
在我的应用程序中的页面之间导航,并且它在 Android(模拟器和设备)中完美运行.
I'm using $("#pagePort").load()
for navigating between pages in my app, and it's working in Android (both emulator & device) perfectly.
但是,当我尝试从 Windows Phone 8 的模拟器运行它时,我的应用无法更改其页面.
However, my app can't change its page when i tried to run it from Windows Phone 8's emulator.
推荐答案
为了使 changePage 功能在 Windows Phone 8 中工作,我已经完成了以下工作.我怀疑这个更改也会使许多事情突然"工作.
I have done the following in order to make the changePage functionality work in Windows Phone 8. I suspect this change will make many things "suddenly" work as well.
此更改应该会在某个时间点成为下一个 jQuery Mobile 版本的一部分...
请尝试一下:
This change is supposed to be part of the next jQuery Mobile release at some point in time...
Please try it:
打开jquery.mobile-1.x.x.js,重构如下代码:
open jquery.mobile-1.x.x.js and refactor the code as follows:
- var uri = url ? this.parseUrl( url ) : location,
- hash = this.parseUrl( url || location.href ).hash;
+ var uri = this.parseUrl( url || location.href ),
+ hash = uri.hash;
和:
- return uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash;
+ return uri.protocol + uri.doubleSlash + uri.host + uri.pathname + uri.search + hash;
这篇关于IBM Worklight - $("#pagePort").load() 在 Windows Phone 8 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!