O'Reilly logo

jQuery Mobile Cookbook by Chetan K Jain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using data-url to handle the login page navigation

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.

Getting ready

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.

How to do it...

The steps to be followed are:

  1. Create two folders called login and records. The login folder will contain main.html, and the records folder will contain the index.html and data.html files.
  2. In the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required