我想设置iframe的HTML代码使用JavaScript设置,正常工作与Firefox和Chrome,但只显示的链接,而无需使用Internet Explorer 9的JavaScript IFRAME与innerHTML的Internet Explorer中
的JavaScript代码样式:
window.frames["iview"].document.body.innerHTML = txt;
把txt变量得到下面的HTML代码:
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
a:link {
color: #0000C0;
background-color: #FFFFFF;
text-decoration: none;
target-new: none;
}
a:hover {
color: #0000FF;
background-color: #808000;
text-decoration: underline;
target-new: none;
}
</style>
</head>
<body>
<a href="http://www.domain.com">link....</a>
</body>
</html>
Internet Explorer中显示的链接,而不是CSS样式...
你把所有上面的代码放入iframe的正文部分? – 2011-05-28 09:40:09
是的,有没有办法设置头部以及? – Joe 2011-05-28 10:13:41