PHP JSON无响应代码

PHP JSON无响应代码,php,jquery,ajax,json,Php,Jquery,Ajax,Json,有人能帮我解决我的ajax调用中的响应问题吗 var dashboardReq = $.ajax({ url: apiPath + 'dashboard_mobile.php?token=' + token + '&format=json' //dataType: 'json' }); 它不断以以下方式出现: dashboardReq.error(function(data, jqxhr) { conso

有人能帮我解决我的ajax调用中的响应问题吗

       var dashboardReq = $.ajax({
        url: apiPath + 'dashboard_mobile.php?token=' + token + '&format=json'
        //dataType: 'json'
    });
它不断以以下方式出现:

      dashboardReq.error(function(data, jqxhr) {
        console.log(data);
        console.log(jqxhr);
    });
下面是我得到的。我已经在这个阶段使用apiPath成功登录,令牌发送正常,但没有返回任何内容

错误只是说:错误,发现很难排除故障

有什么想法吗

Object {readyState: 0, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…}
abort: function (e){var t=e||T;return l&&l.abort(t),k(0,t),this}
always: function (){return i.done(arguments).fail(arguments),this}
complete: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
done: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
error: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
fail: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
getAllResponseHeaders: function (){return 2===x?a:null}
getResponseHeader: function (e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t}
overrideMimeType: function (e){return x||(p.mimeType=e),this}
pipe: function (){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()}
progress: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
promise: function (e){return null!=e?b.extend(e,r):r}
readyState: 0
responseText: ""
setRequestHeader: function (e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this}
state: function (){return n}
status: 0
statusCode: function (e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this}
statusText: "error"
success: function (){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this}
then: function (){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()}
__proto__: Object
只有在尝试捆绑appMobi时才会发生这种情况

我可以在localhost xampp上运行一切,也可以通过浏览器在web上生活

php文件以以下内容结尾:

    /* output in necessary format */
    if($format == 'json') {
        header('Access-Control-Allow-Origin: *');
        header('Content-type: application/json');
        echo json_encode($output);
    }   
用于桌面上的移动开发


当我在做phonegap时,我必须这样做,所以对你来说可能也是同样的问题。

你得到的响应代码是什么这看起来像是在控制台中查看实际请求…net或网络选项卡…可以准确地看到发送的内容和返回的内容…如果实际收到json,请将其粘贴到jsonlint.com并确保其有效。url在浏览器中打开时是否正确打印json?因为是GET,所以可以直接从那里复制json,根本没有响应代码。此请求没有响应数据available@Solvision:http响应状态为?
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files --disable-web-security