Html 如何让热毛巾模板与IE 8一起工作?
我已经使用热毛巾模板构建了一个原型,该模板在大多数浏览器中都可以找到,但在IE8文档模式下(使用IE9开发工具)查看时什么也不显示。对于code camper示例应用程序,也会发生同样的情况Html 如何让热毛巾模板与IE 8一起工作?,html,internet-explorer,backwards-compatibility,hottowel,Html,Internet Explorer,Backwards Compatibility,Hottowel,我已经使用热毛巾模板构建了一个原型,该模板在大多数浏览器中都可以找到,但在IE8文档模式下(使用IE9开发工具)查看时什么也不显示。对于code camper示例应用程序,也会发生同样的情况 @Styles.Render("~/Content/css") <script type="text/javascript"> if (navigator.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
我的假设是这是一个HTML5问题,所以我尝试了以下方法
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
新脚本包(“~/scripts/compat”)
.Include(“~/scripts/es5 shim.js”)
.Include(“~/scripts/html5shiv.js”)
);@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
@使用System.Web
@使用System.Web.Optimization
热毛巾温泉
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
@Styles.Render(“~/Content/css”)
if(navigator.userAgent.match(/IEMobile\/10\.0/){
var msViewportStyle=document.createElement(“样式”);
var mq=“@@-ms viewport{width:auto!important}”;
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName(“head”)[0].appendChild(msViewportStyle);
}
@Scripts.Render(“~/Scripts/compat”)
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
但问题依然存在。是否有人知道如何解决此问题,或者我是否遗漏了其他内容。在输入之前,只需将es5 Shim和Sham库添加到供应商包中即可
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
bundles.Add(
new ScriptBundle("~/scripts/vendor")
.Include("~/scripts/jquery-{version}.js")
.Include("~/scripts/knockout-{version}.debug.js")
.Include("~/scripts/sammy-{version}.js")
.Include("~/scripts/toastr.js")
.Include("~/scripts/Q.js")
.Include("~/scripts/es5-shim.min.js")
.Include("~/scripts/es5-sham.min.js")
.Include("~/scripts/breeze.debug.js")
.Include("~/scripts/bootstrap.js")
.Include("~/scripts/moment.js")
);
只需在进入之前将es5 Shim和Sham库添加到供应商包中
@Styles.Render("~/Content/css")
<script type="text/javascript">
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
var mq = "@@-ms-viewport{width:auto!important}";
msViewportStyle.appendChild(document.createTextNode(mq));
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
</script>
@Scripts.Render("~/scripts/compat")
bundles.Add(
new ScriptBundle("~/scripts/vendor")
.Include("~/scripts/jquery-{version}.js")
.Include("~/scripts/knockout-{version}.debug.js")
.Include("~/scripts/sammy-{version}.js")
.Include("~/scripts/toastr.js")
.Include("~/scripts/Q.js")
.Include("~/scripts/es5-shim.min.js")
.Include("~/scripts/es5-sham.min.js")
.Include("~/scripts/breeze.debug.js")
.Include("~/scripts/bootstrap.js")
.Include("~/scripts/moment.js")
);