传单区域选择在 Internet Explorer 上删除
Leaflet Areaselect remove on Internet Explorer
正在使用传单区域选择,当我在IE上使用删除功能时,我收到以下错误:
SCRIPT438:对象不支持属性或方法"删除">
文件: 传单区域选择.js, 行: 45, 列: 9
你们中有没有人可以在IE浏览器上运行此功能?我尝试了chrome和Firefox,这很好。
var areaSelect = L.areaSelect({
width:100,
height:150,
keepAspectRatio:true
}).addTo(map);
areaSelect.remove();
这是Plunker上的一个测试用例:http://plnkr.co/edit/Snj1cB?p=preview
做了一些调试/挖掘,这是错误。有问题的容器元素在这里创建:https://github.com/heyman/leaflet-areaselect/blob/master/src/leaflet-areaselect.js#L52 它是通过使用L.DomUtil.create
创建的,它只不过是createElement
的包装器:https://github.com/Leaflet/Leaflet/blob/master/src/dom/DomUtil.js#L22 并应用类名。
在Chrome/Safari(webkit(和Firefox中创建的元素具有本机remove()
方法,这不是根据标准。IE没有,因此错误。根据我的猜测remove
只不过是一个用于执行element.parentNode.removeChild(element);
的包装器 插件的创建者应该使用它来保持跨浏览器兼容。
我建议提交错误报告:https://github.com/heyman/leaflet-areaselect/issues
编辑:已经提出了一个问题,但没有太多的行动/后续行动,发表了评论并链接到这个问题:https://github.com/heyman/leaflet-areaselect/issues/10,所以他也可以重现这一点。
- 视频HTML没有'无法在Internet Explorer 11上工作
- Internet Explorer缺少占位符支持,特别是密码字段
- Internet Explorer中的文本换行错误
- 为什么我在Internet Explorer上看不到html元素
- internet explorer 8兼容模式下的Youtube api错误
- 当浏览器控制台未打开时,为什么要求会导致Internet Explorer 9超时
- Internet Explorer 8. Events
- jQuery表单验证适用于Mozilla和Internet Explorer,但不适用于Chrome或Safari
- element.dataset in Internet Explorer
- Facebook FB.init”;访问被拒绝”;在Internet Explorer 11中
- JavaScript不适用于internet explorer和Firefox,但适用于谷歌
- 在Internet Explorer中,向所选内容添加选项不起作用
- 在Internet Explorer中从二进制文件打开PDF
- elementproblem internet explorer
- 我可以使用哪些方法在Internet Explorer中禁用Alt+*X*
- 如何在Internet Explorer中使用javascript设置cookie
- 只有当alert()在带有AJAX的internet explorer中使用时,Javascript才会更新UI
- sharepoint站点的internet explorer中出现Javascript错误
- Internet Explorer重新加载IFrame
- 如何在不使用Internet Explorer的情况下从未挂起的HTML文件执行程序