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; })(); }
source share