托管Bootstrap / Jquery / HTML5Shiv在IE8中本地中断网站

时间:2014-04-30 18:34:30

标签: javascript jquery css twitter-bootstrap internet-explorer-8

我有一个使用bootstrap构建的网站,它在 IE8 中运行良好。然后我决定,为了让我的网站加载速度更快一点,我将停止从其他服务器中抢夺.js的{​​{1}}和.css个文件并在本地托管它们。这样做会破坏我在IE8中的网站。在IE8中,我得到的东西类似于移动版本。

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

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

bootstrap/jquery/html5shiv/etc

这是新代码不起作用:

   <!-- 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>

1 个答案:

答案 0 :(得分:-1)

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