在发布请求期间找不到文件异常

时间:2013-08-27 18:49:00

标签: javascript post

我开发了以下源代码,以便将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]

0 个答案:

没有答案