首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10

    x-ua-compatible 用来指定IE浏览器解析编译页面的model x-ua-compatible 头标签大小写不敏感,必须用在 head 中,必须在除 title 外的其他 meta 之前使用。 1、使用一行代码来指定浏览器使用特定的文档模式。 <meta http-equiv="x-ua-compatible" content="IE=9" > <meta http-equiv="x-ua-compatible" content="IE=8" > <meta http-equiv="x-ua-compatible" content="IE=7" > 2、在一些情况下,我们需要限定浏览器对文档的解析到某一特定版本,或者将浏览器限定到一些旧版本的表现中。可以用如下的方式: <meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" > <meta http-equiv="x-ua-compatible" content="IE=EmulateIE8" > <meta http-equiv="x-ua-compatible" content="IE=EmulateIE7" > 使用这种写法,浏览器或者使用标准模式进行解析,或者使用 IE5 Quirks 模式进行解析。 3、为了测试,我们也可以使用下面的语句指定浏览器按照最高的标准模式解析页面。 <meta http-equiv="x-ua-compatible" content="IE=edge" > 4、多个模式的指定。我们可以用逗号分割多个版本,这种情况下,浏览器会从这个列表中选择一个他所支持的最高版本来使用标准模式进行渲染。如下面的例子,在IE8进行浏览时,将会使用IE7的标准模式进行渲染,因为他本身不支持IE9和IE10。 <meta http-equiv="x-ua-compatible" content="IE=7,9,10" > 参考: http://www.cnblogs.com/cocowool/archive/2013/04/25/3043832.html http://www.cnblogs.com/nidilzhang/archive/2010/01/09/1642887.html http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10 2012-04-25 16:29:04| 分类: 学习 |字号 订阅 在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案 百度也应用了这种方案去解决IE的兼容问题 百度源代码如下 <!Doctype html> <html xmlns=http://www.w3.org/1999/xhtml xmlns:bd=http://www.baidu.com/2010/xbdml> <head> <meta http-equiv=Content-Type content=“text/html;charset=utf-8″> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7> <title>百度一下,你就知道 </title> <script>var wpo={start:new Date*1,pid:109,page:‘superpage’}</script> <meta http-equiv=X-UA-Compatible content=IE=EmulateIE7> 可以打开百度,右键查看源码看下!我们可以看下文件头是否存在这样一行代码! 这句话的意思是强制使用IE7模式来解析网页代码! 在这里送上几种IE使用模式! <meta http-equiv=“X-UA-Compatible” content=“IE=8″> 2. Google Chrome Frame也可以让IE用上Chrome的引擎: <meta http-equiv=“X-UA-Compatible” content=“chrome=1″ /> 3.强制IE8使用IE7模式来解析 <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE7″><!– IE7 mode –> //或者 <meta http-equiv=“X-UA-Compatible” content=“IE=7″><!– IE7 mode –> 4.强制IE8使用I

    02

    毕业一年左右的 前端 妹子 面经总结

    嗯ennnnnn,,,,懒癌症拖延的毛病,趁着最后一个上班日赶紧把最近一周的面试做个总结(虽然我下周一才入职),作为一位去年才毕业的前端妹子来说,其实还是个技术小白啦,近几年还是想在技术上能有一个很大的提升,而且不是说金三银四嘛(嘤嘤嘤,好像是真的),所以在试水了两家公司之后,开启了我一周左右的面经之路,大大小小的公司都有面,我就是奔着涨知识和积累经验去的!!!加起来差不多10家公司左右吧,成绩自己也还挺满意的,拿到了6家公司的offer,大小公司也都有,像大华、华三,但是最终综合考虑的结果,去了一家自己面试体验最好的公司,至少也是一家上市公司啦~

    02

    浏览器模拟F11

    var fullindex=1; function fullscreen(){  if ($.browser.msie && $.browser.version.indexOf("8") == 0) {   if(typeof window.ActiveXObject != "undefined") {      //for IE8,这里和fullScreen相同,模拟按下F11键退出全屏         var wscript = new ActiveXObject("WScript.Shell");          if(wscript != null) {          wscript.SendKeys("{F11}");          }    }  }else if(parseInt(fullindex)==1){   var docElm = document.documentElement;           //W3C           if (docElm.requestFullscreen) {              docElm.requestFullscreen();          }              //FireFox           else if (docElm.mozRequestFullScreen) {              docElm.mozRequestFullScreen();          }              //Chrome等           else if (docElm.webkitRequestFullScreen) {              docElm.webkitRequestFullScreen();          }              //IE11           else if (docElm.msRequestFullscreen) {           docElm.msRequestFullscreen();          }   fullindex=0;  }else if(parseInt(fullindex)==0){   if (document.exitFullscreen) {              document.exitFullscreen();          }          else if (document.mozCancelFullScreen) {              document.mozCancelFullScreen();

    02
    领券