阅读背景:

AJAX和PHP - 两种不同的错误,具体取决于JSON dataType的使用

来源:互联网 

I'm trying to bring my web skills into the 21st century by learning AJAX and PHP but have hit a wall. I want to populate a select control "recipe" with options depending on what was chosen from an initial select control "category". The option items for the secondary control "recipe" will be the parsed results from an AJAX query executed against a PostgreSQL database table. The function "makeAjaxRequestCategory" shown in the code below is a jQuery AJAX call which includes the property dataType: 'json'. This is where the problem is. Best I can figure, the problem comes when I include that property and let the code run, which, instead of returning something with results I can parse, returns as an error... BUT the response object also indicates status 200 (which is "OK"... so why is it being interpreted as an error?). The responseText property of the response object includes the following: I'm trying to bring my web skills into the 21st




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: