internet-explorer - Angular JS ng-style 和 Internet Explorer 8

标签 internet-explorer internet-explorer-8 angularjs

我有一个我似乎无法理解的问题。

在 IE8 中,指令 ng-style 似乎根本不起作用。我用它来设置元素的宽度。在所有其他浏览器上它工作正常。

在 IE8 上,使用蹩脚的 F12 工具检查元素,样式属性完全丢失。

任何人都可以告诉我是否有解决方法?我使用的 angularjs 版本是撰写本文时的稳定版本 (1.0.2)

谢谢

最佳答案

好的,我找到了为什么 {{ }} 在 IE7 中不起作用:您必须对 JSON.stringify 进行 polyfill,因为它用于显示对象而 IE7 没有它,如果您显示一个字符串,它正在工作:

http://jsfiddle.net/NLrYx/3/

更多关于 IE7 兼容的信息:http://docs.angularjs.org/guide/ie

JSON 脚本:https://github.com/douglascrockford/JSON-js/blob/master/json2.js

关于internet-explorer - Angular JS ng-style 和 Internet Explorer 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12642188/

相关文章:

javascript - CSS 的 jQuery IE10 行为 ('background-position' )

javascript - 网站屏幕分辨率自动调整大小

javascript - jquery.find()在ie中返回null,但在其他浏览器中不返回

angularjs - Angular Router - $watch 状态参数不起作用

javascript - Angular 应用程序中 src 项的 404 错误

javascript - jQuery 预加载仅适用于刷新时的 ie

javascript - 如何更改 HTML 元素样式,然后使用 JS 在 onLoad() 上恢复它?

iframe - 将浏览器开发人员工具控制台上下文切换到特定的 iframe

javascript - 如何在 IE8 中使用响应 JS 应用 2 个媒体查询?

angularjs - 从不同的 Controller 修改 $rootscope 属性