0

I can't figure this one out for the life of me... I have the following simple div block:

<div id="result">Loading...</div>

and the following simple JQuery code:

$.ajax({
  cache: false,
  url: "/bogus-url",
  method: "GET",
  success: function(data) {
    $("#result").html(data);
  },
  error: function(xhr) {
    $("#result").html('Error occurred: ' + xhr.status + ' ' + xhr.statusText);
  }
});

When I run it on one machine I get

Error occurred: 404 Not Found

and yet, when I run it another machine I get

Error occurred: 404 error

In fact I have created a JSFiddle that demonstrates this. I'm curious which version you guys get when you run it. Does anyone know what would cause this difference in behavior?

PillowMetal
  • 735
  • 1
  • 7
  • 14
  • 1
    The status code (404) defines the result, not the text. – Andreas Feb 08 '20 at 11:54
  • Yes, but my question is why the same jQuery code returning the same status code would have different status text dependent on where it is run... what process determines the text that is placed in the statusText field? – PillowMetal Feb 08 '20 at 12:33
  • The application on the server, the web server, the client browser, the library used for the request or any party (that has access to the http packets) in between that path... – Andreas Feb 08 '20 at 13:18
  • In my case, the app, the web, and the library are identical because it's all under JSFiddle's control... the only difference is the Chrome browser version (updating is under group policy on one of my machines)... I will try to eliminate that remaining variable – PillowMetal Feb 08 '20 at 18:40

0 Answers0