1

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.

4

1 回答 1

2

要求您的用户

  1. 清除浏览器缓存并重试
  2. 检查您的网站(或从 CDN 呈现的任何 javascript 文件)是否列在用户浏览器的阻止列表中
  3. 检查用户的浏览器权限是否设置为高

考虑到这些情况,我真的无法想到

于 2012-11-05T07:31:41.897 回答