我已经转载了这个问题与铬(与Firefox和IE工作正常)。 我有两个文件,一个是test_index.html,另一个是test.html。铬Javascript和框架无法正常工作
的test_index的代码如下:
<html>
<head>
<meta name=description content="">
<meta name=keywords content="">
<Title></Title>
</head>
<frameset cols="190,*" framespacing="0" border="0" frameborder="0">
<frame name="menu_frame" target="principale" src="test.html" marginwidth="0" marginheight="0" scrolling="auto">
<frame name="principale" src="" scrolling="no" marginwidth="0" marginheight="0" target="principale">
</frameset>
</html>
test.html中的代码如下:
<html>
<head>
<script type="text/javascript">
function writedoc() {
newWindow = window.open('','principale','width=100%');
newWindow.document.open();
newWindow.document.writeln('<html><head><title>Pictures Slide Show</title></head><body><p>Hello World</p></body></html>');
}
</script>
</head>
<body>
<input type="button" onclick="writedoc()" />
</body>
</html>
所以,当我按一下按钮没有任何反应在铬,我是什么?做错了?
嗨,只是柜面你不知道帧在HTML不赞成现在:http://stackoverflow.com/questions/4263509/why-are-frames-deprecated-in-html –
这是一个很lo因为我们不推荐使用框架,因为我们不推荐使用这些框架,但我认为您不需要这样做'window.open'来引用'principale'框架 –
如果您在本地运行这个框架,Chrome阻止帧,因为它们是跨域的。这应该在服务器上工作,但。但你真的应该将属性值包裹在引号中... – Teemu