加载使用AJAX外部内容 [英] Load external content using AJAX
问题描述
是否有可能加载使用jQuery的Ajax,而不是一个iFrame的外部网站的内容?
Is it possible to load an external site's content using jQuery's Ajax rather than an iFrame?
这是我所努力实现的目标,但它似乎有可能与此有些跨域问题?
This is what I am trying to achieve, but it would seem there might be some cross domain issues with this?
$('#result').load('http://www.google.com');
在闪光,你可以把一个跨域策略文件中的站点的根目录允许某些网站访问的SWF文件或其他文件的内容。这是东西,可以使用AJAX来完成?
In flash you can put a cross-domain policy file in the root of the site allow certain sites to access the content of swf files or other files. Is this something that could be done using AJAX?
谢谢, 詹姆斯
推荐答案
这是可能的,部分。你需要让你的服务器作为一个代理:
It is possible, in part. You'll need to have your server act as a proxy:
$('#result').load('fetch.php?s=http://www.google.com');
// or something like that
至于具有客户机下载一个页面跨域,也不会(不应)是可能的。
As for having the client load a page cross-domain, it won't (shouldn't) be possible.
这篇关于加载使用AJAX外部内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!