0

我开发了以下源代码,以便将 json 字符串发送到服务器:

httpRequest.open("POST", url, true);
httpRequest.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
httpRequest.onreadystatechange = function ()
{
    if(httpRequest.readyState == 4 && httpRequest.status == 200)
        alert(httpRequest.responseText);
}
httpRequest.send("parameters="+JSON.stringify(myJSONObject));

包含我JSON.stringify(myJSONObject)的 json 数据。send 方法向我抛出以下异常,我非常了解:

[Exception... "File error: Not found"  
nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  
location: "JS frame :: chrome://___file.js :: method :: line 150"  data: no]
4

0 回答 0