组件返回故障code:0x805e0006错误 [英] Component returned failure code: 0x805e0006 error

查看:273
本文介绍了组件返回故障code:0x805e0006错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的JQuery GET 电话:

The following JQuery get call:

var doc_root = document.location.hostname + ":8082";
var fw_script = doc_root + "/sites/MyScripts/fw2.php";
var langpref = "EN";

var ttype = "BEGIN";
var vvalue = $("#inp_begin").val();

$.get(fw_script, { type: ttype, value: vvalue, langpref: langpref })
    .success(function(result) {
        $(fw_result).text(result);
        alert("Success");
    })
    .error(function(jqXHR, textStatus, errorThrown) {
        $(fw_result).text("Error: " + textStatus + " " + errorThrown);
        alert("Failure");
    });

时,产生以下错误消息( .error 叫):

is generating the following error message (.error is called):

Error: error [Exception... "Component returned failure code: 0x805e0006
[nsIXMLHttpRequest.open]" nsresult: "0x805e0006 (<unknown>)" location: "JS frame ::
http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
:: <TOP_LEVEL> :: line 4" data: no]

我不知道这消息是,我无法找到太多的解释和我的谷歌搜索。任何人都可以澄清?

I have no idea what this message is and I can't find much explanation with my Googling. Can anyone clarify?

更新

被叫URL被构造为在Javascript以下

The called URL is constructed as following in Javascript:

var doc_root = document.location.hostname + ":8082";
var fw_script = doc_root + "/sites/MyScripts/fw2.php";

fw_script 的值是:

fw.localhost:8082/sites/MyScripts/fw2.php

它是由一个名为

It is called from

fw.localhost:8082/en

当我尝试 fw.localhost:8082 /网站/ MyScripts / fw2.php 在我的浏览器,它是成功的。

When I try fw.localhost:8082/sites/MyScripts/fw2.php in my browser, it is successful.

推荐答案

看起来很可能你正在处理一个跨域请求错误。按照同源策略,你不能,即使让一个Ajax请求的主机具有不同的端口号,这是同一个域。它看起来像你设置的doc_root 到不同的产地,根据这个定义,所以你可能会得到一个错误的Ajax请求。

Looks very likely that you're dealing with a cross-domain request error. According to the Same Origin Policy, you can't make an AJAX request to a host with a different port number, even if it's the same domain. It looks like you're setting doc_root to a different origin, by this definition, so you'll likely get an error on the AJAX request.

有关修复这个标准的选项:

The standard options for fixing this:

  • 这是你正在做的请求,在同一台主机为你的数据。

  • Serve your data from the same host you're making the request from.

使用JSONP而不是JSON。

Use JSONP instead of JSON.

这篇关于组件返回故障code:0x805e0006错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆