I have a static website, which I run on my local machine using jetty server (for testing) , and on github pages(live).
The source code is exactly same for both the sites. I used same browser (Mozilla Firefox) for below test I recently used the following code for a jQuery Ajax
$.ajax({
url: jsonFilePath,
error: function (response) {... },
success: function (responsedata) {
var responsedata = JSON.parse(latestData);
...
The above code worked fine while running on my local server, but failed while running on github server (same browser)
It failed on github for this reason. It started working after defining dataType as below
$.ajax({
url: jsonFilePath,
dataType: "json",
...
My Question here is, Why was this not caught during testing on local server? All the liberaries, data, json, js, jQuery files are same. What might have caused this difference in behaviour?