Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.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
Javascript 在IE8中本地托管Bootstrap/Jquery/HTML5Shiv会破坏站点_Javascript_Jquery_Css_Twitter Bootstrap_Internet Explorer 8 - Fatal编程技术网

Javascript 在IE8中本地托管Bootstrap/Jquery/HTML5Shiv会破坏站点

Javascript 在IE8中本地托管Bootstrap/Jquery/HTML5Shiv会破坏站点,javascript,jquery,css,twitter-bootstrap,internet-explorer-8,Javascript,Jquery,Css,Twitter Bootstrap,Internet Explorer 8,我有一个使用bootstrap构建的站点,它在IE8中运行良好。然后我决定,为了让我的网站加载得更快一点,我将停止从其他服务器为bootstrap/jquery/html5shiv/etc绑定各种.js和.css文件,并在本地托管它们。这样做破坏了我在IE8中的网站。在IE8中,我得到了一些类似于移动版的东西 知道我做错了什么吗?我应该可以在本地托管所有这些文件,对吗 以下是我的标签中最初有效的内容: <!-- Bootstrap core CSS --> <lin

我有一个使用bootstrap构建的站点,它在IE8中运行良好。然后我决定,为了让我的网站加载得更快一点,我将停止从其他服务器为
bootstrap/jquery/html5shiv/etc
绑定各种
.js
.css
文件,并在本地托管它们。这样做破坏了我在IE8中的网站。在IE8中,我得到了一些类似于移动版的东西

知道我做错了什么吗?我应该可以在本地托管所有这些文件,对吗

以下是我的标签中最初有效的内容:

   <!-- Bootstrap core CSS -->



<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">

    <link href="/css/ffnv4.4.css" rel="stylesheet">

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>


<script type="text/javascript">
     if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
        var msViewportStyle = document.createElement("style");
        msViewportStyle.appendChild(
            document.createTextNode(
                "@-ms-viewport{width:auto!important}"
            )
        );
        document.getElementsByTagName("head")[0].
            appendChild(msViewportStyle);
    }
</script>

if(navigator.userAgent.match(/IEMobile\/10\.0/){
var msViewportStyle=document.createElement(“样式”);
msViewportStyle.appendChild(
document.createTextNode(
“@-ms视口{宽度:自动!重要}”
)
);
document.getElementsByTagName(“head”)[0]。
appendChild(msViewportStyle);
}
以下是不起作用的新代码:

    <!-- Bootstrap core CSS -->



<link href="<? echo CONTENT_SERVER; ?>/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
  <script src="<? echo CONTENT_SERVER; ?>/js/html5shiv.js"></script>
  <script src="<? echo CONTENT_SERVER; ?>/js/respond.min.js"></script>
<![endif]-->



        <link href="<? echo CONTENT_SERVER; ?>/css/ffnv4.4.css" rel="stylesheet">

<script type="text/javascript" src="<? echo CONTENT_SERVER; ?>/js/jquery.js"></script>
<script src="<? echo CONTENT_SERVER; ?>/bootstrap/js/bootstrap.js"></script>

<script type="text/javascript">
     if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
        var msViewportStyle = document.createElement("style");
        msViewportStyle.appendChild(
            document.createTextNode(
                "@-ms-viewport{width:auto!important}"
            )
        );
        document.getElementsByTagName("head")[0].
            appendChild(msViewportStyle);
    }
</script>


因为Twitter BootStarp3和jquery版本2没有放弃IE8支持。

respond.js
没有被加载。我猜你正在尝试通过http
http
加载它,但你没有使用web服务器…@ChrisHardie我绝对是在使用web服务器。你肯定你的文件路径是正确的吗?你的开发工具是否注意到任何错误?这是不对的。如果我使用远程托管的文件,它可以工作。Bootstrap v3支持IE8: