我有一个简单的功能,可以在登录后更改页面.页面更改后,我想运行一个不同的功能来加载地图.
function doLogin(username, password){
show_load("logging in...");
Parse.User.logIn(username, password, {
success: function(user){
window.localStorage.setItem("userObjectId", user.objectid);
hide_load();
$.mobile.changePage("home.html", {transition: "slide"}, true, true);
$("#home_page").on("pageshow", function(){
navigator.notification.alert("hello");
});
},
error: function(user, error){
hide_load();
$(".error_popup_title").text("login error");
$(".error_popup_content").text(error.message);
$("#error_popup_link").click();
}
});
Run Code Online (Sandbox Code Playgroud)
}
在它改变页面后我想运行一个函数调用showMap();
无论我做什么,我都会在调用更改页面后无法运行任何内容.甚至没有警报!