【发布时间】:2015-07-28 06:13:41
【问题描述】:
我想从我的网站链接中获取 html 页面,并像 html 一样再次将其注入到我的 google chrome 扩展中的 popup.html 页面中
我需要使用 JavaScript 来编写代码,我不需要任何 jquery,因为
我之前用 jquery 做了一部分
$.get('some website ', function(data) {
$('.result').html(data);
alert('Load was performed.');
});
但我希望 JavaScript 代码从我想在代码中定义它的链接中获取 html
例如,我有像www.something.com/page.html 这样的网站
我需要获取 page.html 的源代码并将其注入 popup.html
这意味着扩展程序将显示page.html
我希望这是一个很好的解释
【问题讨论】:
-
您只是在寻找 innerHTML 吗?理解你的问题有点困难......
-
您想要一个 iframe 来在弹出窗口中显示您的网站,还是想要从您的网站复制 html 并将其放入您的弹出窗口中?
-
不,我需要从页面获取 html,例如:www.some.com/page.html 之后我需要在 popup.html 中发布 page.html
标签: javascript html google-chrome google-chrome-extension