Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11940 closed bug (invalid)

Ajax request on Android after a back

Reported by: jorslb@… Owned by: jorslb@…
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 7 years ago by jorslb@…

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

comment:2 Changed 7 years ago by dmethvin

Owner: set to jorslb@…
Status: newpending

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 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

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!

Note: See TracTickets for help on using tickets.