问题描述
我们正在使用 Worklight 6.0.0 企业版,目前正在构建适用于 android、BB、Windows Phone 8 和 iOS 的混合应用程序.
We are using Worklight 6.0.0 enterprise edition and currently building hybrid apps for android, BB, Windows Phone 8 and iOS.
我们当前在单击注销按钮时调用 WL.Client.reloadApp()
时遇到以下错误.这适用于除 WP8 之外的所有操作系统.
We are currently getting the below error when invoking WL.Client.reloadApp()
when clicking on a logout button. This works fine all OSs except for WP8.
CordovaBrowser_NavigationFailed ::///www/default/www/default/pages/www/default/pages/www/default/pages/www/default/pages/myaccount.html错误:InvokeScriptCallback 中的异常 :: 出现未知错误发生了.错误:80020006.错误:InvokeScriptCallback 中的异常::出现未知错误.错误:80020006.
这是我们的注销功能:
logout() {
window.localStorage.clear();
$.mobile.changePage("../MainPage.html");
$('#username').val('');
$('#password').val('');
$("#Footer").show();
$("#ui_logoutlst").hide();
$("#homeBt_menu").hide();
$('ul#QuickLinks li').width('50%');
};
推荐答案
2014 年 4 月 8 日更新
我在之前的回答中使用了您提供的示例项目.
这是更新版本:WindowsTestApp
I have used the sample project you've provided in my previous answer.
Here's an updated version: WindowsTestApp
我做了什么:
在
wlCommonInit()
中删除了path
变量的使用.
Removed use of the
path
variable inwlCommonInit()
.
在 $.mobile.changePage()
中添加了 changeHash: false
选项.
Added the changeHash: false
option to $.mobile.changePage()
.
例如:$.mobile.changePage("Pages/MyAccount.html", { changeHash: false });
在 WindowTestApp.html 中
In WindowTestApp.html
从 HEAD
元素中删除了这一行:
Removed this line from the HEAD
element:
在 jsjquery-1.10.2.js 中:
In jsjquery-1.10.2.js:
查找
xhr.open(s.type, s.url, s.async);
改为
s.url = s.url.replace("x-wmapp0:///", "");
xhr.open(s.type, s.url, s.async);
第 3 步是在使用 WL.Client.reloadApp()
的情况下正确使用 changePage
.
Step 3 is correct use of changePage
in case of using WL.Client.reloadApp()
.
第 4 步似乎是 jQuery/jQuery Mobile 中特定于处理 Windows Phone 中文件位置的错误.
Step 4 seems to be a bug in jQuery/jQuery Mobile specific to handling to file location in Windows Phone.
这篇关于IBM Worklight 6.0 - WL.Client.reloadApp() 在 Windows Phone 8 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!