首页 > 代码库 > 浏览器兼容性随笔

浏览器兼容性随笔

1、用ie8时强制用ie8解析,需要加下面的话,这句话会强制ie8浏览器按照ie8的 

<meta http-equiv="X-UA-Compatible" content="IE=8">

2、ie8 如何防止console没有定义,加下面的代码

window.console = window.console || (function(){ 	var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile 	= c.clear = c.exception = c.trace = c.assert = function(){}; 	return c; })();

3、如何获取浏览器的版本

浏览器兼容性随笔