问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/29749970/angular-js-script5007-object-expected-error-in-ie9-and-ie10-upon-loading-the