9

I am developing an AngularJS application that should run on Firefox and IE 9 and IE 10. I use the latest version of angularjs library (now it is 1.3.15). The serverside is written in Java in JavaEE platform and server runs on GlassFish, and our computers run windows 7.

Everything works fine when I am running the server locally on my computer and access my application using the http://localhost:8080 url.

But in IE9 and IE10, when I try to load the application from my server by using my ip address (something like http://191.10.10.200:8080) then angularJS library fails to load. It gives an error saying:

SCRIPT5007: Object expected angular.min.js, line 7 character 218

Can this be an issue with the security settings of IE? Or the network? I looked for similar issues but none was talking about this problem. Please help me if have an idea how can this be resolved.

6
  • Have you tried running this with the unminified version of Angular to get a better error message? You could see where it was failing at. Commented Apr 20, 2015 at 14:03
  • Thanks you, yes. Then I get the same error. This time in line 335 character 12. That is in forEach function where isArray object is being checked, So the expected object should be isArray. isArray is defined in line 599. Commented Apr 20, 2015 at 16:15
  • So without seeing exactly what is causing the issue here, it is difficult to say. I would suggest opening up the Dev tools (F-12) and putting a breakpoint on that line so you can see exactly what it is complaining about. Commented Apr 20, 2015 at 17:26
  • 1
    When you load the page using the IP address, is the document mode (as reported by the F12 tools) the same as it is when you load the page from localhost? If not, then you're running into a situation where the way you load your page changes the rendering context. Use MotW to ensure the page is loaded from the Internet zone and use x-ua-compatible to ensure that the correct docmode is enabled. Commented Apr 20, 2015 at 19:05
  • 5
    Thank you very much for your replies. Yes @LanceLeonard, that seems to have been the problem. IE was running in IE7 document mode when accessing the server through IP. So by using the meta tag <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta> it is forced to use the latest document mode and thus angularjs library loads correctly. Commented Apr 21, 2015 at 9:09

1 Answer 1

2

I had the same error which only occurred in IE9 and IE10 when I was loading a page requiring AngularJS.

My page was simply missing the DOCTYPE header from the top of the page:

<!DOCTYPE html> 

Once I added it AngularJS loaded just fine for me.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.