火狐浏览器不支持jquery中的.before() 事件,如何做到兼容性?
按照这篇文章的说法http://www.haorooms.com/post/js_shixian_jquery 尝试了下:
//JQUERY
$(el).before(htmlString);
//js谷歌浏览器,火狐浏览器,IE8+
el.insertAdjacentHTML('beforebegin', htmlString);
还有w3school http://www.w3school.com.cn/jsref/met_node_insertbefore.asp
document.getElementById("myList").insertBefore(newItem,existingItem);
但是并没有用,所以来求助,
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
before不是事件。
我的记忆中,before不存在这个不兼容性的说法。