角JS" SCRIPT5007:预期的对象"在加载角库错误在IE9和IE10加载、对象、错误、QUOT

2023-09-13 03:04:55 作者:你贱得太过耀眼

我开发,应该在Firefox和IE 9和IE 10运行AngularJS应用程序。我用的是最新版本的angularjs图书馆(现在是1.3.15)。在服务器端是用Java编写的在GlassFish的JavaEE平台和服务器运行,我们的计算机运行Windows 7。

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.

一切,当我在我的计算机上运行的本地服务器和访问应用程序中使用的http://本地主机:8080 网址

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

但在IE9和IE10,当我尝试使用我的IP地址(类似 http://191.10.10.200加载从我的服务器应用:8080 ),然后angularJS库加载失败。它给出了一个错误的说法:

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:预期的对象angular.min.js,第7行字218

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

可这是与IE浏览器的安全设置的问题吗?或网络?我找了类似的问题,但没有谈论这个问题。请帮助我,如果有一个想法,这可怎么解决的。

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.

推荐答案

我只当我需要加载一个AngularJS页面发生在IE9和IE10同样的错误。

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

我的页面只是简单地缺少从页面顶部的DOCTYPE头:

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

<!DOCTYPE html>

在我添加它AngularJS装就好了我。

Once I added it AngularJS loaded just fine for me.