Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在构建一个站点,我想使用 jQuery 在 div 中动态加载外部内容。内容可以是谷歌搜索页面,无需离开网站即可导航。有人可以利用这个并驱动到他自己的内容并在我的网站内运行恶意代码吗?有没有办法防止这种情况?使用 iframe 是最好的选择吗?
在进行跨域 AJAX 时,您主要关心的是跨站点请求伪造和跨站点脚本。一个快速的谷歌搜索,揭示了这篇文章。因此,我建议您不要转述,而是建议您去阅读它并点击一些链接,以更深入地讨论您正在开放的论点。