Going to another page using jQuery

Is it possible to navigate from one page to another by navigating to a jQuery page? I currently have an input window that launches the focus function, for example:

$("#page1").on("focusout", "input", function(){
 alert("working");
}

What I would like to do is, after the focus function is triggered, I would like to go to another page using the jquery mobile page navigation page. Normally I would use a button like this:

<a href="#page2">Next</a>

How can I run #page2out of focus function?

+3
source share
2 answers

If it is on the same page. It should be.

//Solution From Comments Below; Thanks!
$.mobile.pagecontainer( "change", "#page2", { transition:"slide" } );

//Original Answer Deprecated
$.mobile.changePage($('#page2'), {transition:"slide"});
+8
source

To change the page on a jQuery mobile device, use:

$.mobile.changePage("yourpage.html", {transition:"slide"});

where the slide can be changed to other transitions

+2
source

All Articles