开发者

Redirect to home page

开发者 https://www.devze.com 2023-02-14 11:00 出处:网络
Is it possible to 开发者_JAVA百科\"redirect\" users from a subpage ie. index.htm#sub-page to index.htm#home with the mobileinit function?

Is it possible to 开发者_JAVA百科"redirect" users from a subpage ie. index.htm#sub-page to index.htm#home with the mobileinit function?

$(document).bind("mobileinit", function(){
    $.mobile.changePage("/index.htm#home");
});


And why not

$(document).bind("mobileinit", function(){
    document.location.href="whereever";
});

or just

<script>
document.location.href="whereever";
</script>

or even with a metatag?


$.mobile.changePage('#page_two');

This one worked for me.


Yes. If you use redirect, the non-ajax web page must reload more than 100KB of JQuery JS.... I still don't want to, but in some cases it must be done by page reload (to handle the PHP Session carefully).

0

精彩评论

暂无评论...
验证码 换一张
取 消