解决iframe的frameborder在chrome/ff/ie下的差异
时间:2023-08-09 00:23:24
var iframe = document.createElement("iframe");
iframe.id = "frame-" + index;
iframe.src = url;
iframe.width = "100%";
iframe.marginwidth = "0";
iframe.scrolling = "no";
iframe.frameborder="0";
使用IE中“查看选定区域源代码”发现创建的iframe代码是<IFRAME frameborder=0/>,网上搜了下资料,原来是IE不认小写,我晕死....
使用
setAttribute("frameborder", "0", 0);
//问题解决了。
var iframe = document.createElement("iframe");
iframe.src = url;
iframe.width = "100%";
iframe.marginwidth = "0";
iframe.scrolling = "no";
iframe.setAttribute("frameborder", "0", 0); //最后一个0表示是否区别大小写,问题解决
标签:iframe,frameborder
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python 保存float类型的小数的位数方法
2021-06-28 05:44:12
Python3多线程爬虫实例讲解代码
2021-01-10 21:45:28
python结合selenium获取XX省交通违章数据的实现思路及代码
2022-04-15 21:30:57
![](https://img.aspxhome.com/file/2023/9/86479_0s.png)
MySQL 查询的排序、分页相关
2024-01-19 18:26:59
mysql出现10061错误解决办法
2010-07-04 13:36:00
python将ip地址转换成整数的方法
2022-10-17 23:40:23
Asp生成RSS的类_给网站加上RSS
2011-04-19 11:06:00
SQL语句如何实现超简单的多表查询
2024-01-21 15:42:05
![](https://img.aspxhome.com/file/2023/0/94480_0s.png)
详解Python中__str__和__repr__方法的区别
2023-02-28 17:29:17
PyTorch一小时掌握之神经网络气温预测篇
2022-07-30 23:52:19
![](https://img.aspxhome.com/file/2023/4/110384_0s.jpg)
python 判断参数为Nonetype类型或空的实例
2021-03-21 07:15:17
python算法题 链表反转详解
2021-01-26 11:47:35
![](https://img.aspxhome.com/file/2023/1/92201_0s.jpg)
利用Python第三方库xlrd读取Excel中数据实例代码
2023-02-17 05:28:58
![](https://img.aspxhome.com/file/2023/6/121856_0s.jpg)
GO语言标准错误处理机制error用法实例
2024-02-13 18:07:20
Python提取Word中图片的实现步骤
2022-11-07 20:25:10
![](https://img.aspxhome.com/file/2023/3/105723_0s.png)
Vue watch原理源码层深入讲解
2024-04-30 10:40:58
![](https://img.aspxhome.com/file/2023/3/130093_0s.png)
Pytorch实现LSTM和GRU示例
2022-02-08 09:14:44
![](https://img.aspxhome.com/file/2023/0/121510_0s.jpg)
JavaScript错误处理
2023-09-23 08:26:37
python 自动监控最新邮件并读取的操作
2023-02-04 12:58:51
python多进程提取处理大量文本的关键词方法
2022-02-17 13:07:36
![](https://img.aspxhome.com/file/2023/7/67837_0s.jpg)