我正在编写一些greaseMonkey 脚本,将外部url 中的html 合并到当前页面中。
我听说由于同源策略,在 JavaScript 中这样做可能会出现问题,但是 GreaseMonkey 是否支持所需的服务器端脚本(jQuery),或者是通过某些外部 js 的 get 方法我可以使用库/API 吗?
[编辑]是否可以通过添加 iframe 并引用其中的外部 url 来“获取”html?
最佳答案
GM_xmlhttpRequest不受同源策略影响
关于javascript - 从 GreaseMonkey 中的外部 url 获取 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6317426/