我有一个简单的功能,可以在登录后更改页面。页面更改后,我想运行不同的功能来加载地图。
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();
    }
});
}
在它改变页面之后,我想运行一个函数调用 showMap();
在调用更改页面后,无论我做什么,我都无法运行任何东西。连警报都没有!