Redirect to home page

Is it possible to "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");
});

Upvotes: 1

Views: 12454

Answers (3)

vafrcor
vafrcor

Reputation: 11

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).

Upvotes: 1

Joe L.
Joe L.

Reputation: 4643

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

This one worked for me.

Upvotes: 3

naugtur
naugtur

Reputation: 16915

And why not

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

or just

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

or even with a metatag?

Upvotes: 3

Related Questions