本篇文章记录一下touchstart、touchmove、touchend点击事件的event参数在safari浏览器中无法获取path的解决方案
解决方案通过composedPath 获取 event.path
function touch(event) { var path = event.path || (event.composedPath && event.composedPath()) || ''; } document.addEventListener('touchstart', touch, false); document.addEventListener('touchmove', touch, false); document.addEventListener('touchend', touch, false);