Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 虚拟服务器无法检测浏览器版本_Html_Linux_Internet Explorer_Virtualbox - Fatal编程技术网

Html 虚拟服务器无法检测浏览器版本

Html 虚拟服务器无法检测浏览器版本,html,linux,internet-explorer,virtualbox,Html,Linux,Internet Explorer,Virtualbox,我正在我的虚拟机(开发服务器)上的Ubuntu上运行Apache2 我有以下代码: <!--[if lt IE 9]> U r using an old browser! <![endif]--> 我使用的是IE9,它在prod服务器上运行良好。但是,当我在本地开发服务器上测试我的站点时,我不断收到“旧浏览器”消息 这是什么原因造成的 我找到了罪犯。正是这种怪癖导致了头痛。下面一行解决了这个问题: <meta http-equiv="X-UA-

我正在我的虚拟机(开发服务器)上的Ubuntu上运行Apache2

我有以下代码:

  <!--[if lt IE 9]>
    U r using an old browser!
  <![endif]-->

我使用的是IE9,它在prod服务器上运行良好。但是,当我在本地开发服务器上测试我的站点时,我不断收到“旧浏览器”消息

这是什么原因造成的

我找到了罪犯。正是这种怪癖导致了头痛。下面一行解决了这个问题:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

如果您使用
localhost
127.0.0.1
访问您的本地站点,这可能与。Internet Explorer 8在本地站点的兼容性方面引入了“智能默认设置”:

如今,许多业务线网站都支持Internet Explorer 7。为了保持兼容性,Internet Explorer 8附带了基于区域评估的智能默认值。在默认状态下,公用internet上的所有站点均以internet Explorer 8标准模式显示(兼容性视图关闭),所有intranet网站均以internet Explorer 7标准模式显示(兼容性视图打开)

我不知道IE9是如何处理的,但这可能是罪魁祸首


在这种情况下,请尝试使用其他域名(如
stevendev
或其他什么)访问您的本地开发人员站点。这将使IE进入正常模式。

这都是客户端的问题,与服务器无关。你选择了兼容模式吗?丹尼尔,为什么这在我的生产服务器上工作?嗯。。。。我不知道。我的Ubuntu服务器从DHCP接收IP地址,所以我没有使用
localhost
127.0.0.2
。我只需要在我的PHP文件中添加一个检查,看看我是否是prod server上的测试服务器。谢谢你的信息。@Steven嗯,奇怪。那不太可能是因为。。。您可以尝试将兼容模式强制设置为IE9,看看它是否工作得更好。我找到了解决方案。这是因为怪癖模式。添加这个解决了它(我想)