目前我正在使用它来保存 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
关于javascript - 在 iframe 中运行 js 函数,IE7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9092911/