在我的一个网页中,我使用了以下 JavaScript 行:
return !!(a.compareDocumentPosition(b) & 16);
但是,仅在 IE9 中,我收到以下错误:
Object doesn't support property or method 'compareDocumentPosition'
其他浏览器工作正常。有谁知道可用的修复或解决方法吗?
最佳答案
Internet Explorer supports compareDocumentPosition only in IE9 mode. Make sure you have at the beginning of your markup and document.documentMode returns 9
关于javascript - 仅在 IE9 中不支持方法 compareDocumentPosition,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7460630/