【发布时间】:2011-01-09 11:04:44
【问题描述】:
这似乎是一个常见问题,我看到的解决方案似乎对我不起作用。
我们有一个动态生成和插入的 iframe,以及一个提交给它的表单。在 FF 和 IE8 中运行良好,但在 7 中我们遇到了 iframe 名称问题(IE 不想使用 element.name 或 element.setAttribute("name",) 设置 iframe 名称)。
所以我已经将我们的代码转换为:
函数 insertTrafRepiFrame(){ var contDiv = document.getElementById('trafficReportDiv'); if(contDiv != null){ 变量 iFrame; 尝试{ iFrame = document.createElement('IFRAME'); }抓住(前){ iFrame = document.createElement('【问题讨论】:
标签: javascript iframe