Dziamid
Dziamid

Reputation: 11579

Page data-url attribute is not respected

When I do a redirect from /form page to a /thank-you page (e.g. after successful form submission) I want the page url to change, so I add a "data-url" attribute like this:

<div id="page-thank" data-role="page" data-url="/thank-you"> ... </div>

The problem is that the URL of the page does not always change. In cases when it doesn't change the div of the page in the DOM look like this:

<div id="page-thank" data-role="page" data-url="/form" data-external-page="true"> ... </div>

Notice the data-url attribute has been changed (if you look at the response code, it is /thank-you) and data-external-page attribute has been added. Why is this happening?

Upvotes: 1

Views: 651

Answers (1)

GerjanOnline
GerjanOnline

Reputation: 1881

data-url is more for internal use for jQuery Mobile. Why not just use $.mobile.changePage with the url of page id?

Upvotes: 3

Related Questions