加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows-phone-7 – jQuery Mobile changePage()无法在Windows P

发布时间:2020-12-13 20:33:47 所属栏目:Windows 来源:网络整理
导读:我正在使用Phonegap for Windows Phone 8开发一个应用程序. 我使用jQuery Mobile进行界面设计. $.mobile.changePage()不起作用.页面未被更改. 有没有其他方法来改变页面?是否还有其他框架来设计移动界面? $("#btnSearch").bind('click',function() { showS
我正在使用Phonegap for Windows Phone 8开发一个应用程序.

我使用jQuery Mobile进行界面设计.

$.mobile.changePage()不起作用.页面未被更改.

有没有其他方法来改变页面?是否还有其他框架来设计移动界面?

$("#btnSearch").bind('click',function() {
    showSpinner();
    $.mobile.changePage("#pageSearch");
});
我认为这个问题与 here中描述的WP7相同.

检查路径问题:

if($.mobile.path.getLocation("x-wmapp1:/app/www/index.html") != "x-wmapp1:/app/www/index.html")
{
    console.log('there is path problem');
}
else
{
    console.log('everything is OK with paths');
}

解:

如github中所述,问题是WP7上的路径与其他平台不同.基本上在WP7上,getLocation打印带有双斜线的相对路径,这会导致首先出现此问题.要解决此问题,请打开jquery.mobile-1.3.1.js并重构以下内容:

-        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;

进行此更改后,检查应显示“一切正常”.

PS这是在WP7上测试的,完全修复了$.mobile.changePage()的问题.

PS2这个问题在jQuery的github版本中得到修复,虽然我刚刚检查了最新的稳定版本(1.3.2),但不幸的是它没有修复.

问候,

Hristo Todorov

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读