There is another very important use case for data-url - which during redirection:
Say the user goes to /store/youraccount , but they are not logged in. Perhaps your server will redirect them to the login page /store/login . This returns to the browser as a 301 redirect that loads without jQuery Mobile, even knowing the changes. The page will display correctly, but the URL at the top will be store/youraccount .
By setting data-url on the login page like this, jQuery mobile can correctly update the URL after the redirect, which means that it can be bookmarked and <form> tags without action will work.
How data-url stops <form> from breaking:
If your page contains a <form> tag defined without an action attribute, then it will return to the current page by default - if you guessed that the browser still thinks we are on /store/youraccount
Therefore, when you put data-url='/store/login , it can correctly update the url.
<div data-role="page" data-url="/store/login" class="ui-page ui-body-c ui-page-active" id="page_">
Note. Even if your form has an action , you still need to set the data url. This is just an example showing how dropping url data can break things.
source share