开发者

Using <?access-control allow=""?> PI with cross domain XMLHttpRequest

开发者 https://www.devze.com 2023-02-20 07:46 出处:网络
I\'m making a cross domain request in an html file for an xml file using XMLHttpRequest. I want to use the PI <?access-control allow=\"requestingdomain.com\"?>

I'm making a cross domain request in an html file for an xml file using XMLHttpRequest.

I want to use the PI <?access-control allow="requestingdomain.com"?>

as outlined here http://www.w3.org/TR/2005/NOTE-access-control-20050613/

in the requested xml file, rather than getting into setting headers.

However it see开发者_如何学Cms to have no effect, I still can not retrieve the xml document(using firefox 3.6.15 at least).

Is this not implemented, and there's no getting around having to set Access-Control-Allow-Origin headers etc? Or am I missing something.

thank you


here the right code

<?php header('Access-Control-Allow-Origin: http://requestingdomain.com'); ?>

more details https://developer.mozilla.org/En/Server-Side_Access_Control

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号