We have a framework that, when a user logs in, a Location header is passed back from PHP.
It appears that JQM is picking up on this header and causing a page transition to the POST URL, while loading the content at the redirected location. This is an issue when, for example, the page is refreshed and the browser attempts to access the wrong resource.
We are also (but I do not suspect this is related) processing most hyperlinks with the following code:
var href = this.href, page = pageName_get(href);
// if the page is still loading, don't allow more clicks. each page preloads,
// and it would cause each clicked page to load in succession after the previous page finished loading
if (page_load.loading) return false;
allowSamePageTransition : false,
changeHash : true,
reloadPage : false,
reverse : false,
showLoadMsg : true,
transition : 'slide',
type : 'get'
Of further note, we only create one div (in the initial document) with data-role="page" while each successive page is pulled in via ajax.
User logs in and POSTs to "/member/post."
Browser receives "Location: /" header.
JQM AJAX loads "/" and does a page transition, but URL is not updated in browser.
User hits refresh and "/member/post" is accessed via GET.
Browser: Google Chrome 15.0.874.102 beta
OS: Darwin 10.8.0
OS: Android 2.3.4
We'll have to take a look, but is that a way to post a jsbin that illustrates this? Seems tricky to make a test page in this situation. In the meantime, did you read through all the Ajax nav details here, might give you some hints:
Apologies for the months-long delay. Please view an example here: http://www.aaronholmes.net/jqm/
The "post it" button submits to /jqm/post.php, which sends a "Location: /jqm/" header.
The content is loaded correctly, but the URL contains "/jqm/post.php"
For your reference: http://jsbin.com/ajohac/5
Note that jsbin is making a post to a different domain, and so everything behaves at expected.
Of interesting note, if the form action is "http://aaronholmes.net/jqm/post.php" instead of "/jqm/post.php," JQM behaves as expected as well.
Edit: scratch my last sentence, wasn't paying attention to the "www." part of my domain.
+1. Using Symfony 2.1 framework, I have a stackoverflow question about it too: http://stackoverflow.com/questions/12516902/symfony-2-and-jquery-mobile-1-1-1
Workaround found: If data-ajax is false, it works like charm, although ajax is not used (of course).
<form method="post" action="/logincheck" data-ajax="false">
solves the problem.
Hey @gergelypolonkai @aholmes There hasn't been any updates to this issue in over 2 years. Can you confirm if it's still an issue with the latest jQM version or if this can be closed? Thanks
I have not used jQM in the same amount of time, so am unable to confirm if this is still an issue.
@aholmes thank you for responding so quickly. I think ill close this for now then but if any one can still reproduce just comment and we will re open.