【发布时间】:2013-01-05 14:52:05
【问题描述】:
我只想将外部样式表和 js 导入 iframe 的 head 标签。有可能吗?
我已经在 html 头中尝试了一个自定义 jquery 函数`
$(this).contents().find('head').append('<link href="http://mywebsite.com/css/iframe.css?" rel="stylesheet" type="text/css" />')`
【问题讨论】:
-
我怀疑 iframe 在您包含样式表时已经呈现,因此这将不起作用。您无法访问要包含在 iframe 中的页面吗?
-
@drmonkeyninja 我无法访问我正在调用的页面,但需要在其中进行一些 CSS 更改,并在其中包含自定义滚动条。
-
出于安全原因,我认为这是不可能的。这样您就可以轻松更改汇款信息等..
-
“mywebsite”真的是你的网站吗?
-
no "mywebsite" 不是我的,但我保留了 'mywebsite' 作为文本来隐藏我的原始网站。