[英]Why is there strange behaviour on IE11?
我的jQuery Mobile网站的部署版本似乎存在问题。 在本地计算机上运行,看起来还可以。
但是,当部署到测试服务器时,jQuery Mobile的用户界面遇到了问题(如下图所示)。 我已经在IE11和Chrome上测试了已部署的网页。 在Chrome上,它看起来完全像本地托管版本,因此在IE11上只是“奇怪”的iu。
除了文件的路径(css / js)外,两个版本的HTML源当然是相同的,但是在Chrome上,它在两个“版本”上均有效。
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width" initial-scale="1" />
<!-- Styles -->
<link href="/Content/Site.css" rel="stylesheet" type="text/css"/>
<link href="/Content/jquery.mobile-1.4.2.css" rel="stylesheet" type="text/css"/>
<link href="/Content/jquery.mobile.datepicker.css" rel="stylesheet" type="text/css"/>
<!-- Scripts -->
<script src="/Scripts/Bundles/jquery?v=_evuqQpQzfiv74i_e2xne0q8qDFolKEd-XnaMgC-rWw1"></script>
<script src="/Scripts/jquery.ui.datepicker-nb-NO.js"></script>
<script src="/Scripts/Bundles/jqueryMobile?v=sCRDQK2ukYmfF8e6gB7crpqBhGj3REAZ0OWnxCy4ozU1"></script>
</head>
<body>
<div data-role="page" data-theme="a">
<div data-role="header" data-theme="a">
<a href="/" data-icon="home" data-iconpos="notext">Home</a>
<h1></h1>
</div>
<div data-role="content">
<a href='#' data-role="button"><div><div class="btn-icon-text">Button 1</div></div></a>
<a href='#' data-role="button"><div><div class="btn-icon-text">Button 2</div></div></a>
</div>
<div data-role="footer" data-position="fixed" data-theme="a">
<div id="leftBottomContent" style="float: left"><a href="#" data-rel="back" class="ui-btn">back</a></div>
<div id="rightBottomContent" style="float: right"></div>
<div id="centerBottomContent" style="margin-left: auto; margin-right: auto; text-align: center; margin-top: 15px;"></div>
</div>
</div>
</body>
</html>
我已经使用Fiddler检查了服务器的请求是否正常。 谁能指出我的想法来解决这个问题?
因此,在您自己的PC上设置兼容模式可以为您解决问题,但是其他尝试使用您的应用程序的人呢?
您可以在布局中添加一个meta
标头,以强制使用兼容模式,从而使其兼容,从而使其他人不会遇到与您看到的相同的问题
<meta http-equiv="X-UA-Compatible" content="IE=9">
确保在HTML中<head>
标记后立即添加此标记
在Intranet网站上关闭兼容模式解决了我的问题
在您的标题页中添加以下代码,这使用户在使用应用程序时默认使用兼容模式:
<%
response.addHeader("X-UA-Compatible", "IE=edge");
%>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.