English 中文(简体)
XDoma 带有原型的 XDML 种子
原标题:X-Domain XML Feed with Prototype

好吧,所以原型 将不是我的选择 但客户网站使用它,我必须适应。

我从A站点传来XML信号 我的职能是:

new Ajax.Request( somefeedurl.ashx ,
{
    method: get ,
    onSuccess: function(transport){
        console.log("Transport: "+transport)
        myParseXml(transport.responseXML);
    },
    onFailure: function(){
        alert( Something went wrong... )
    }
});

我实施了一个交叉域域. xml 文件, 允许访问feedurl. com, 但我仍然得到相同的来源: Access- Control-Allow- Oligin 不允许访问。

使用原型手法有办法吗?

作为第二个问题。 一旦我绕过它, 我是否正确运行了这个函数 : MyParseXML () 来实际进行处理? Ie is transaction. refuseXML 会从种子中提供 XML 数据吗?

regards, Robert

问题回答

否。如果提供 XML 种子的其他网站不< a href=>“http://en.wikipedia.org/wiki/Cross-ground_resource_share” rel=“nofollow” > 明确允许跨域请求 ,由于,您无法(直接)使用Ajax检索它,因为“a href=” http://en.wikipedia.org/wiki/Same_ground_policy” rel=“nofolfol”>sop -任何“工作变通”都将是一个安全漏洞。

无论你用什么图书馆来包扎克斯的电话

另见XMLHTTPrequest ,其中>onsucess 处理器 。回答第二个问题:否,responXML 已经被文件引用。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签