帮助! Flash 无法从第三方域加载 XML 数据
我使用 RSS 源从雅虎获取新闻,使用:
XML.load("http://finance.yahoo.com/rss/topstories")
是 这是合法的,虽然当我的 SWF 离线时它可以正常工作 - 它显示安全错误,但我允许我的 D 驱动器“域”在 Adobe 安全面板。
但是,当我将其上传到我的服务器并在线测试时:
在 Firefox3 中,数据加载失败,在状态栏上显示一条消息“正在从 Finance.yahoo.com 传输数据”
在 InternetExplorer7 中,它会默默地失败,没有任何消息或警告。
发生了什么? 我什至放置了一个带有 * 通配符的 crossdomain.xml 文件(允许所有域)。
I am getting news from Yahoo using an RSS feed, using:
XML.load("http://finance.yahoo.com/rss/topstories")
Yea this is legal and all, and although it works perfectly when my SWF is offline -- it shows a security error, but I allow my D drive "domain" in the Adobe Security Panel.
But as soon as I upload it to my server, and test it online:
In Firefox3 the data fails to load, giving me a message on the status bar "Transferring data from finance.yahoo.com"
In InternetExplorer7 it fails silently with no message or warning.
Whats happening? I've even put a crossdomain.xml file with a * wildcard (allowing all domains).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
似乎您需要雅虎的子域才能访问此内容。
http://finance.yahoo.com/crossdomain.xml
快速解决方法是在您自己的服务器上设置代理脚本。 那里有很多例子。 没有尝试过,但那家伙写它的原因与你相同:
http ://www.abdulqabiz.com/blog/archives/general/php_proxy_script_for.php
Seems like you need a subdomain at Yahoo to access this.
http://finance.yahoo.com/crossdomain.xml
A quick walk-around is to set up a proxy-script on your own server. There's a lot of examples out there. Haven't tried this but the guy wrote it for the same reason as you :
http://www.abdulqabiz.com/blog/archives/general/php_proxy_script_for.php
问题在于您的 crossdomain.xml ...实际上将其添加到您的网站上没有任何效果,您必须要求雅虎将其放在他们的域上:-)
The problem is with your crossdomain.xml ... Actually adding it on your site has no effect, you have to ask Yahoo to put it on their domain :-)
我不确定这里到底出了什么问题,我认为您需要给我更多细节。
我强烈建议您完整地阅读本文。
http://www.adobe.com/devnet/flash/articles/fplayer8_security。 html
此外,跨域仅适用于您请求的域到,而不来自。
它还可以帮助您安装 Fiddler
http://www.fiddler2.com/fiddler2/
或者Charles
http://www.charlesproxy.com/
这将允许您更好地进行 http 调试。 我的猜测是您的安全沙箱行为存在冲突。
I'm not sure what exactly is wrong here, you need to give me some more details I think.
I highly recommend you read this completely.
http://www.adobe.com/devnet/flash/articles/fplayer8_security.html
Also, a cross domain is only applicable to the domain you are requesting to not from.
It may also help you to install Fiddler
http://www.fiddler2.com/fiddler2/
Or Charles
http://www.charlesproxy.com/
This will allow you better http debugging. My guess is that you have a conflicting security sandbox behavior.