I am using IBM Worklight Studio version_6.0.0.20130926-2018.
In my app I am using the jQuery Mobile framework.
My problem is that when I try to load a data-role="page"
using $.mobile.changePage
, the page is not refreshed by itself. When I refresh this page, the JavaScript code is not working.
Instead, I get the following errors:
ReferenceError: WLJQ is not defined profile.html:11
TypeError: $ is undefined jquery.mobile-1.3.2.js:28
ReferenceError: $ is not defined profile.js:3
ReferenceError: WL is not defined
The $.mobile.changePage
code:
//redirect to profile
function redirectToProfile(profileId){
if(profileId == null || profileId == ""){
$("#failMessage").fadeIn();
}
else{
var dataurl = '?profileID='+profileId;
$("#failMessage").fadeOut(200, function(){$("#loginSuccess").fadeIn(function(){$.mobile.changePage('pages/profile.html'+dataurl, {reloadPage : true,transition: "slide"});});});
}
}
});
How to solve this in Worklight?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…