使用jquery设置浏览器模式 [英] To set the browser mode by using jquery

查看:162
本文介绍了使用jquery设置浏览器模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我打开我的网站时,它都会在浏览器模式下打开:IE8兼容性视图。我不希望我的网站在8或9的兼容性视图中打开。

我需要使用jquery或C#设置IE的浏览器模式。已经设置了IE的文档模式,但是无法使用jquery或C#设置IE的浏览器模式。



我不希望手动设置IE的浏览器模式。



请帮我解决这个问题..

提前感谢你。

Whenever i open my website it opens in Browser Mode : IE8 Compatibility View. I don't want my website to open in compatibility view either 8 or 9.
I need to set a Browser Mode of IE using jquery or C#. Document Mode of IE had been set but Browser mode of IE could not be set using jquery or C#.

I don't want Browser Mode of IE to be set manually.

Please help me to resolve this problem..
Thanking You in advance.

推荐答案

你可以使用 META 标签来做到这一点。例如,

You could do that by using META Tag. For example,
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >





欲了解更多信息,请查看此页定义文档兼容性 [ ^ ]


试试这个.. :)) />


http ://万维网.toplinestrategies.com / dotneters / net / detecting-ie-compatibility-view-c /?lang = en [ ^ ]
try this..:)

http://www.toplinestrategies.com/dotneters/net/detecting-ie-compatibility-view-c/?lang=en[^]


var j = jQuery.noConflict();
j(document).ready(function(){
    /* detect usage of IE Developer Tools using different Mode for Browser and Document */
    if(j.browser.msie) {
        var browserVersion = j.browser.version.slice(0,j.browser.version.indexOf("."));
        var documentVersion = document.documentMode;
        if(browserVersion != documentVersion) {
            alert("ERROR:\nBrowser Mode and Document Mode do not match!\n\nBrowser Mode: IE"+ browserVersion +".0\nDocument Mode: IE"+ documentVersion +".0");
        }
    }
});


这篇关于使用jquery设置浏览器模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆