繁体   English   中英

在iframe,IE7中运行js函数

[英]Running a js function in an iframe, IE7

目前,我正在使用它来保存iframe中的内容(仅适用于IE)

var $iframe = $('#auditframe').get(0).contentWindow;

$iframe.document.open("text/xml", "replace");
$iframe.document.write(xml);
$iframe.document.execCommand('SaveAs',true, 'test.xml');

除某些运行IE7的计算机外,此方法有效。 当我在主页上使用document.execCommand时,它可以工作,但不能从iframe中使用。 有什么办法可以将此代码修改为其他替代方法? 或可能是什么原因造成的? 任何帮助深表感谢。 谢谢!

答案+修复了sp2: http : //support.microsoft.com/kb/929863

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM