Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

记录一些烦人的浏览器兼容性问题 #13

Open
yinxin630 opened this issue May 30, 2019 · 0 comments
Open

记录一些烦人的浏览器兼容性问题 #13

yinxin630 opened this issue May 30, 2019 · 0 comments
Labels

Comments

@yinxin630
Copy link
Owner

yinxin630 commented May 30, 2019

如果你也遇到了相同问题, 希望能帮助你快速修复问题

安卓UC浏览器手指滑动会触发前进/后退和页面缩放

在 touch 系列事件中, 可以通过 event.preventDefault() 阻止浏览器默认行为

在安卓UC中, 仅在 touchmove 事件中调用 preventDefault() 并不管用, 还需要在 touchstarttouchend 事件中也调用 preventDefault()

然后就能禁用掉了

但是!!! 要注意, 如果在 touchend 中调用了 preventDefault(), 就不会触发 click 事件了!!!

IE浏览器不支持 Child​Node​.remove

image

MDN上提供了该方法的 polyfill, 引入即可

https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove#Polyfill

IE浏览器不支持 SVGElement.outerHTML

如果该 节点没有兄弟节点

const outerHTML = $svg.parentNode.innerHTML;

如果有兄弟节点

const $div = document.createElement('div');
$div.appendChild($svg.cloneNode());
const otherHTML = $div.innerHTML;

IE浏览器, 派生类不能访问基类静态属性

我不确定 ECMAScript 规范中是否有对该行为的定义, 在别的浏览器中是可以的

修复方法: 改为从基类读取静态属性

@yinxin630 yinxin630 added the Web label May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant