Opened 11 years ago
Closed 11 years ago
#11940 closed bug (invalid)
Ajax request on Android after a back
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi, I want to report a real big problem that apears after a Back on Android. If I'm requesting the same URL on a Ajax request after a Back, even with Cache Off, it doesnt request a retrieves the wrong content.
If I access by the html, access other site, do the back, Ajax works. If I access by the php, access other site, do the back, Ajax doesnt works.
otherPage.html
<!DOCTYPE html> <html> <head> <title>Test</title> <meta content="text/html; charset=UTF-8" name="content-type"/> <meta content="yes" name="apple-mobile-web-app-capable"/> <meta content="black" name="apple-mobile-web-app-status-bar-style"/> <meta content="width=device-width" name="viewport"/> <script src="jquery-1.7.2.min.js" type="text/javascript" /> <!--include--> </script> <script src="script.js" type="text/javascript"> <!--include--> </script> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" name="viewport"/> </head> <body> <div onclick="request();"> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> DO REQUEST<br> </div> <div id="result"> </div> </body> </html>
script.js
function request(){ $.ajaxSetup({cache:false}); $.ajax({ url: "samePage.php", type: "POST", cache: false, data: "p=1", success: function(data) { console.log(data); $("#result").html(data); }, cache: false, error:function (xhr, textStatus, thrownError){ console.log(textStatus); $("#result").html(textStatus); } }); }
samePage.php
<?php if(isset($_POST['p'])){ echo 'Hello random'.rand(0,100); }else{ echo file_get_contents("otherPage.html"); } ?>
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
it doesnt request a retrieves the wrong content
Sorry but that isn't clear.
Can you provide a page somewhere that demonstrates the problem? Ideally it would be at jsFiddle.net if it can be reproduced there. See the help links there for how to do ajax requests. Also, please test with the latest version to see if that works: http://code.jquery.com/jquery-git.js
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
After the Back, when I press the div the Apache doesnt log anything.
Testing with Android 2.3.7 and Android 4.0
I also used jquery-1.6.4.min