ajax跨域获取xml
我确信这个问题以前已经被问过。可能没有办法解决这个问题。我只是想试试运气。
那么我可以通过这种方式进行跨域ajax调用来获取xml吗?如果有怎么办?
| client |<--->| Server |
^
|
|
------>| other domain (such as toutube) |
I'm sure this question has been asked before. there might be no way around it. I just want to try my luck.
so can I do a crossdomain ajax call to get xml in this way? if there is how?
| client |<--->| Server |
^
|
|
------>| other domain (such as toutube) |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议从本地 .php/.asp/.whatever 文件“弹回”它并让它检索数据。除了完全兼容之外,如果您愿意的话,它还有助于添加缓存层。
类似:
/ajax/load.php?url=
当然,您很可能希望将其锁定。没必要被用作邪恶的工具。
I'd recommend "bouncing" it off of a local .php/.asp/.whatever file and have it retrieve the data. In addition to being fully compliant, it also helps in adding a caching layer should you so desire.
Something like:
/ajax/load.php?url=
Of course, you're going to most likely want to lock it down. No need to be used as a tool of evil.