lundi 13 avril 2015

Ajax read json console warning


Vote count:

0




I have the following ajax call:



var employeeData = (function () {
var employeeData = null;
$.ajax({
'async': false,
'global': false,
'url': "docs/employees.json",
'dataType': "json",
'success': function (data) {
employeeData = data;
}
});
return employeeData;
})();


and produces the following error:


Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://ift.tt/ZyN3LX.


But the json data is returned to my employeeData variable and I can access all of the properties within the object.


However, If I don't set async to false, which sets the default to true nothing is returned to my employeeData variable and is null yet the warning is gone.



asked 52 secs ago







Ajax read json console warning

Aucun commentaire:

Enregistrer un commentaire