JS相关:
1、FF浏览器下不兼容innerText
解决方案:
/** | |
* [innerText的FF兼容] | |
*/ | |
if (!('innerText' in document.body)) { | |
HTMLElement.prototype.__defineGetter__('innerText', function(){ | |
return this.textContent; | |
}); | |
HTMLElement.prototype.__defineSetter__('innerText', function(s) { | |
return this.textContent = s; | |
}); | |
} |
2、IE8/9下不能使用console.log
如果使用环境包含IE8/9,请养成良好习惯,用if (window.console) { ... }包住console.log()动作,切忌把IE8/9想成Chrome/Firefox,以为永远有window.console可用。