IBM Worklight 6.0 - 未触发jQuery Mobile页面显示事件

时间:2013-10-02 14:51:38

标签: jquery-mobile ibm-mobilefirst

我在使用jQuery Mobile 1.3.0的Worklight项目中遇到了一个问题。

页面显示良好,但未触发pageshow个事件 页面初始化时,Web控制台会记录2个javascript错误:

TypeError: invalid 'in' operand profile @ http://myhost:10080/myProject/apps/services/preview/InfoCenter/common/0/default/wlclient/js/worklight.js:2569

TypeError: ajaxRequest is undefined @ http://myhost:10080/myProject/apps/services/preview/InfoCenter/common/0/default/wlclient/js/wlclient.js:2460

1 个答案:

答案 0 :(得分:0)

如果您从应用中提供了一些代码段,那会更好......

使用此代码,pageshow对我有效:

function wlCommonInit(){
    $(document).on("pageshow", "#page2", function(event) {
        alert("page 2 loaded");
    });
}

当我的基于Worklight 6.1的jQuery Mobile 1.3.1应用程序使用changePage更改页面时,将执行上述操作并显示警报。我在Worklight Console MBS中测试了它。

Here's a sample project