强制 IE 11“用户代理字符串"使用标签 [英] Force IE 11 "User agent string" using tags
问题描述
我的网站在 IE11 中坏了.
My website is broken in IE11.
我们都知道HTML标签允许开发者强制IE兼容模式;例如
We all know that HTML tags allow developer to force IE compatibility mode; in example
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9" />
效果很好,解决了 IE10 的可视化问题.
worked great and solved the visualization problems for IE10.
但实际上在 IE11 上,即使 Compatibility mode
设置为 IE9
,User agent string
设置为 default代码> 和 javascript 不起作用.手动将
User agent string
更改为 IE10
解决了我的问题.
But actually on IE11, even if Compatibility mode
is set to IE9
, User agent string
is set to default
and javascript doesn't work.
Changing manually User agent string
to IE10
solved my problems.
对于 shure,我将解决导致网站错误的实际问题,但实际上我需要一种快速的、程序化的方式来强制将用户代理字符串"设置为 IE10,因为我不能联系每一位用户.
For shure I'm going to solve the real problems that cause website errors, but actually I need a fast, programatic way to force "User agent string" to IE10, since I can't contact every user.
有人可以帮忙吗?
推荐答案
解决了!网站刚刚在服务器上安装了 Dotnet 框架 4.5
实际上我没有找到以编程方式强制浏览器用户代理字符串的方法(这是最初的问题).但是用0代码修复了网站..
Actually I didn't find a way to force programmatically browsers User agent string (this was the original question). But repaired website with 0 code..
刚刚进行了大量测试,在一台服务器上我发现该网站可以正常工作,而在另一台服务器上却没有.
Just made lot of tests and on one server I found out that website was working, on other server it wasn't.
好服务器"是 Win2012,坏服务器"是 Win2008.在 Win2012 上,Aspnet 4.5 正在运行,而在 Win2008 上则没有.
The "good server" was a Win2012, and "bad servers" were Win2008. On Win2012 Aspnet 4.5 was running, and on Win2008 it wasn't.
我也在坏服务器上安装了 dotnet framework 4.5,一切都开始工作了!
I installed dotnet framework 4.5 on bad servers too, and everything started working!
这篇关于强制 IE 11“用户代理字符串"使用标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!