XMLHttpRequest Exception 101 error with ajax

I am using this code on a jQuery mobile website. However, it returns me an error with

{readyState: 0, status: 0, statusText: "Error: NETWORK_ERR: XMLHttpRequest Exception 101"} 

I am stuck here and cannot find out what the problem is! and I did not find a good answer.

 $(function () { calldata(); }); function calldata() { var url = "http://www.mywebsite.com/json.php" ; var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': url, 'error': function (data) { console.log(data); }, 'success': function (data) { json = data; console.log(data); } }); return json; })(); } 
+2
source share
1 answer

Solved = P

  $.ajax({ 'async': false, 'global': false, 'dataType': 'JSON', // this line was missing 'url': url, 'error': function (data) { console.log(data); }, 'success': function (data) { json = data; console.log(json); } }); 
+3
source

All Articles