IE中的Javascript getters / setters? [英] Javascript getters/setters in IE?

查看:159
本文介绍了IE中的Javascript getters / setters?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论出于何种原因,自定义对象的 Javascript getters / setters 似乎使用任何浏览器,但IE。

For whatever reason, Javascript getters/setters for custom objects seem to work with any browser but IE.

IE是否有任何其他非标准机制? (与许多其他功能一样)

Does IE have any other non-standard mechanism for this? (As with many other features)

如果没有,是否有任何变通方法可以实现相同的功能?

If not, are there any workarounds to achieve the same functionality?

推荐答案

IE8通过 defineProperty ,但仅适用于DOM对象。但据推测,它最终也会出现在JavaScript对象中。

IE8 has it through defineProperty, but only for DOM objects. But supposedly, it'll eventually come for JavaScript objects as well.

这篇关于IE中的Javascript getters / setters?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆