Cross-browser Getter and Setter

前端 未结 4 450
误落风尘
误落风尘 2020-12-23 17:52

This works in modern Chrome/Firefox/Opera but fails in IE8. Haven\'t tried it in IE9. How can I make this cross-browser compatible, including IE7+? (Fiddle here.)

         


        
4条回答
  •  醉梦人生
    2020-12-23 18:34

    I don't believe you can.

    In IE8 and lower, property access is mere property access. There's no way to run function code without explicitly invoking the function.

    I think in IE8 you may be able to with DOM elements, but I don't believe it works for regular native objects.

提交回复
热议问题