When you write a login page in your app, once the user enters valid credentials, you will want to redirect the user to a different page or to a different folder on success. This recipe shows you how to redirect the user to a different page during a login page navigation scenario, by using the data-url
attribute.
Copy the full code of this recipe from the code/02/data-url
sources folder. You can launch this code using the URL http://localhost:8080/02/data-url/login/main.html
.
The steps to be followed are:
Create two folders called
login
andrecords
. Thelogin
folder will containmain.html
, and therecords
folder will contain theindex.html
anddata.html
files.In the
login
folder, createmain.html
as a multi-page document. Here, first add the#main
page as shown in the following code snippet. Also add a link to open the#login
page.<div data-role="page" id="main"> <div data-role="header"> <h1...