2

I'm using Bootstrap 3 framework for a new design. All works fine in Safari, Chrome and Firefox, but not in IE8. I've added respond.min.js and html5shiv.js in my functions.php file. Those files get loaded as I can see in 'inspect-element -> resources" in Chrome.

Still, in IE8, the site is displayed as is is a mobile device, which isn't correct.

How to resolve this?

Alex Shesterov
  • 21,630
  • 10
  • 65
  • 88
Quinox
  • 97
  • 3
  • 10
  • Are your style sheets defined before or after your javascript? – Jason Sperske Sep 23 '13 at 08:21
  • Hi Jason,They are defined before the javascript. – Quinox Sep 23 '13 at 08:27
  • I've been using Initializr for my projects and never had this problem: http://www.initializr.com/ (to clarify: Initializr gives you a pre defined package with respond and Bootstrap already properly set up) – Alexander Rechsteiner Sep 23 '13 at 08:31
  • Hi Alex, Thankx, but doesn't solve my problem at the moment for this project. – Quinox Sep 23 '13 at 08:34
  • I had the same problem but on localhost it worked fine. It seems that respond js works only when site is previewed on server. Use wamp or something. – Vladislav Stanic Sep 23 '13 at 09:04
  • Hi Vladislav, what do you mean with "previewed on server"? – Quinox Sep 23 '13 at 09:10
  • I installed wamp, put my project in there and opened it with http://localhost/my_project and everything worked in ie8. Just try that and see if that solves your problem. – Vladislav Stanic Sep 23 '13 at 09:20
  • That will solve my problem for localhost maybe. But the website will not be hosted on Localhost but By an ISP. So if it works on localhost, it still doesn't work when i host the site by my ISP. – Quinox Sep 23 '13 at 09:25
  • http://stackoverflow.com/questions/15127040/respond-js-not-working-in-ie-8 – Vladislav Stanic Sep 23 '13 at 09:30
  • "Due to security restrictions, some browsers may not allow this script to work on file:// urls (because it uses xmlHttpRequest). Run it on a web server." - this is from respond js site https://github.com/scottjehl/Respond – Vladislav Stanic Sep 23 '13 at 09:37
  • Hi Vladislav, Thanx, but to be sure...i do not understand it at all. I'm running the site on a webserver at my hosting provider, not localhost. I checked "enable protected mode" which was unchecked on my site. – Quinox Sep 23 '13 at 10:06
  • possible duplicate of [IE8 issue with Twitter Bootstrap 3](http://stackoverflow.com/questions/17947182/ie8-issue-with-twitter-bootstrap-3) – Bass Jobsen Sep 23 '13 at 10:07
  • Hi Bass, I do have a local copy if bootstrap.css and have "" in my section of the header file. Maybe worth to mention...I'm using Wordpress – Quinox Sep 23 '13 at 10:14
  • Thank got. got it working now by removing an unused stylesheet from the header.php file. Thanks!! – Quinox Sep 23 '13 at 11:17

3 Answers3

-1

my head tag:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Bootstrap core CSS -->
    <link href="css/modern-business.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/bootstrap.css" rel="stylesheet" media="screen">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/modern-business.js"></script>
     <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.js"></script>
    <![endif]-->  
    </head>

If you want to try in local, try through localhost, or create a QA server and set the content and try.

We need respond.js for bootstrap 3 and it wont work in local machine if we just put it in js and append it to html in header.

It will say access denied, it works only through server as IE has security restriction.

Nathan Koop
  • 23,022
  • 23
  • 86
  • 121
-1

When Googling Bootstrap 3 IE 8 one of the top results is: http://www.telegraphicsinc.com/2013/10/using-bootstrap-3-with-internet-explorer-8-ie8/

Ultimately it says you need to add, "" which you can grab from here: https://code.google.com/p/css3-mediaqueries-js/

cchiera
  • 2,476
  • 10
  • 32
  • 57
-1

Bootstrap will work in IE 8, to do the same follow below steps:

Add below mentioned Scripts Dont use CDN for the same its worth to add those scripts from local folder

<!-- language: lang-html -->

    <!--[if lt IE 9]>
          <script src="../../scripts/IE8/html5shiv.js"></script>
          <script src="../../scripts/IE8/respond.min.js"></script>
        <![endif]-->


<!-- end snippet -->

Download Respond.js And Html5Shiv.js

Note: Adding Sequence would be very important

Add your css first then add those js

Bootstrap.css
YourCustom.css
Respond.js
html5shiv.js

Bootstrap IE Support details : http://getbootstrap.com/getting-started/#support