6

I'm building a one-page website, using AngularJS, ui-router and jquery, and I need it to support ie 8 browsers.
I followed the instructions from the AngularJS documentation (link), and I also read this and followed its instructions.
In a nutshell: I added this code in the header:

<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="myApp">

and also:

<!--[if lt IE 9]>
    <script type="text/javascript" src="/app/js/3rdparty/html5shiv.js"></script>
    <script type="text/javascript" src="/app/js/3rdparty/json3.min.js"></script>
<![endif]-->

All of my directives are restricted to be used as attribute directives (no custom tags).
But still, no view is being rendered, and no directive is working (on ie8).

I started using ui-router only recently, and the problem existed even before.
I really can't find the problem, and I've searched a lot.
There are many duplicates for this, I know, but none of their solutions helped me (and most of them pretty much refer to angularjs's documentation).
I haven't posted any other code, since there's a lot of it, and I really can't figure out what part of the code (other than the index.html) can be causing any problem.
I'll post any other code if you think it might help.
I'm really lost and would really be grateful if someone could guide me to a solution.
Thank you very much

1
  • Could you provide more of the markup? The other included scripts are important too! For example, the latest jQuery versions have dropped support for IE 8. Commented Nov 27, 2013 at 11:16

3 Answers 3

9

In case if you've used any console.log() within your controller or service or factory then IE-8 won't load the angular at all. It's weird.

Sign up to request clarification or add additional context in comments.

2 Comments

It wasn't my case. I recommend using Angular's $log service for that. But thanks for the heads up!
This saved me after hours of head scratching, thank you.
5

Seems I made a bit of a fool out of myself.
The problem was that I was using some reserved words, and apparently IE8 really doesn't like it at all.
For instance I had a parameter named "class" on an object, so using obj.class just made IE8 freak out.
The same with a function named "delete" (again inside an object, so I was using functionHoldingObject.delete.

I knew about reserved words, I just didn't think using them as a parameter of an object is harmful. In order to fix this, I just changed the names for some, and used obj["reservedWord"] for others, both solutions work on all browsers.

Another error I found, was that I was using the Array.prototype.indexOf function without knowing that IE8 doesn't support it. So I just added an implementation (which is very easy).
You could get help on that on the MDN site.

Comments

0

I have met the same problem recently because of the compatibility mode.

Try to force it with :

<!--[if IE 8]><!--> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <!--<![endif]-->

Also check in your IE8 browser that your compatibility mode is not IE7.

1 Comment

Please use " for html in your answer instead of “ and ”

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.