IE8 兼容性问题
来源:互联网 发布:数据服务平台 编辑:程序博客网 时间:2024/06/01 09:33
IE8 兼容性问题
设置script标签内容
在IE8中,下面的代码报错:
$('#invoiceListDot').text(htmlTemplate);
说明:invoiceListDot 是一个script标签
<script id="invoiceListDot" type="text/x-dot-template"> {{? it.invoiceInfoDtos}} {{ for(var prop=0;prop <it.invoiceInfoDtos.length ; prop++){ }} {{? it.invoiceInfoDtos[prop]}} <div class="{{ if(prop==0 && it.create==true){}}invoice-infor {{ }else {}}no-invoice{{ }}}" data-index="{{= prop }}"> <span class="no-ivoice-icon"></span> <span>普通发票</span> <span class="ivo-margin invoiceType">{{= it.invoiceInfoDtos[prop].content }}</span> <span class="ivo-margin invoiceCompany">{{= it.invoiceInfoDtos[prop].title }}</span> <span class="ivo-margin invoiceAddress">{{= it.invoiceInfoDtos[prop].address }}</span> <span class="ivo-margin invoicePerson">{{= it.invoiceInfoDtos[prop].receiver }}</span> <span class="ivo-margin invoicePhone">{{= it.invoiceInfoDtos[prop].phone }}</span> </div> {{?}} {{ } }} {{?}} </script>
改为如下代码也报错:
$('#invoiceListDot').html(htmlTemplate);
这是IE8的兼容性问题.
解决方法:
在js中判断浏览器类型,若是IE8,则执行
$('#invoiceListDot').innerHTML = htmlTemplate;
整个逻辑判断如下:
if (getBrowserVersion.isIE8) { $('#invoiceListDot').innerHTML = htmlTemplate; } else { $('#invoiceListDot').text(htmlTemplate); }
获取script标签的内容的时候:
var tmplate = $invoiceListDot.text();//IE8中返回空字符串 if (!tmplate) { console.log('$invoiceListDot.text() return null'); tmplate = $invoiceListDot.html(); }
IE识别不了有空格的json
比如
{
“path”:”huang wei”
}
IE7中动态创建表格时,必须要创建tbody,否则表格不显示
var tb = put('table.service'); if (BrowserVersion.isIE7 || BrowserVersion.isIE6) { tb=put(tb,'tbody'); }
设置2x背景图片IE8中不显示
有问题的css样式:
background: rgba(0, 0, 0, 0) url("../imgs/placeOrder/icon_select_l@1x_org.png") no-repeat scroll 0 0; background-image: -webkit-image-set(url(../imgs/placeOrder/icon_select_l@1x_org.png) 1x, url(../imgs/placeOrder/icon_select_l@2x_org.png) 2x); background-image: -moz-image-set(url(../imgs/placeOrder/icon_select_l@1x_org.png) 1x, url(../imgs/placeOrder/icon_select_l@2x_org.png) 2x); background-image: -ms-image-set(url(../imgs/placeOrder/icon_select_l@1x_org.png) 1x, url(../imgs/placeOrder/icon_select_l@2x_org.png) 2x); background-image: -o-image-set(url(../imgs/placeOrder/icon_select_l@1x_org.png) 1x, url(../imgs/placeOrder/icon_select_l@2x_org.png) 2x);
改为:
li 标签的value属性
html li标签设置value诡异的问题
设置html标签的自定义属性
0 0
- IE8 兼容性问题
- IE8兼容性问题
- VS2005与IE8兼容性问题
- IE8 padding兼容性问题
- IE8的兼容性问题
- position:fixed ie8兼容性问题
- jQuery EasyUI IE8 兼容性问题
- Carousel在IE8兼容性问题
- IE8 、 IE7 的兼容性问题
- swiper3.4 IE8兼容性问题
- IE8兼容性问题汇总1
- IE8的兼容性问题
- ueditor ie8兼容性问题
- IE8 兼容性问题总结
- IE6、IE7、IE8、FF兼容性问题
- ie8兼容性问题的快速解决办法
- IE6、 IE7、IE8、Firefox兼容性问题
- qc9.0与IE8兼容性问题
- bootstrap--导航
- 一个 IT 青年北漂四年的感悟
- Chrome保存mht网页文件的方法(无需插件)
- Android Tips 7
- can not write to the data/tmp folder
- IE8 兼容性问题
- 机器学习中的概率公式
- 解决RecycleView分割线不居中
- java 反射机制
- 最短路【SPFA】
- myEclipse10.x 配置jad反编译工具
- poj 2114 Boatherds
- 由站桩而感
- pch文件添加