I have a simple ajax request that works for most of my users. However, for one user, no ajax request is sent when he clicks the button. The ajax request fails silently - no error message. No network traffic to mydomain.
Here is a simplified version of the problem that still has the error in it. (i.e. when my user clicks the button nothing happens). When I click the button, it works.
The javascript:
$(document).ready(function() {
$("#message").html("<p>GOT HERE</p>");
$("#analyzebutton").click(function() {
$.ajax({
url: 'http://www.mydomain.com/myrequest.php' ,
type: "POST",
data: {custclass: 'testclass', text: 'this is a test'},
dataType: 'json',
success: function(data, textStatus, jqXHR){ var tempp = '<p>SUCCESS!</p>'; $('#message').html(tempp);
},
error: function(jqXHR, textStatus, errorThrown) {
var tempp = '<p>ERROR!</p>' +textStatus;
$('#message').html(tempp);
}
});
})
});
The relevant HTML is:
<a href="#" id="analyzebutton">BUTTON-CLICK THIS TEXT</a>
<div id="message"></div>
As extra information: the real application that I have extracted this from is much more complex than this. However, on the real page, if my user presses F5 and then clicks the button, the ajax call actually happens correctly.
Both he and I use IE9. It all works for me but not for him.
Any ideas what the difference may be? My site used to work for him when he had IE8. Now that he has come back a few months later, he is having this problem.
He has no other browsers on his computer, so I don't know how the ajax behaves on another browser.