Javascript post请求期间未找到文件异常

Javascript post请求期间未找到文件异常,javascript,post,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.

为了向服务器发送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数据的
JSON.stringify(myJSONObject)
。 send方法向我抛出以下异常,我非常理解:

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

我会检查你发布到的URL。此外,请尝试禁用所有扩展或在其他浏览器中尝试(从而确认一个或多个浏览器扩展是罪魁祸首)。我发现了问题,只需在url中添加“http://”。