元素和节点是IE领域的二等公民 [英] Element and Node are second class citizens in IE land

查看:43
本文介绍了元素和节点是IE领域的二等公民的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在FF中你可以定义以下内容......


Element.prototype.getClass = function(){return this.className; / *或

无论* /}

Element.prototype.setClass = function(c){this.className = c; }


但它在IE中不起作用。


基本上在IE中,元素和节点是第二类对象,没有

原型行为,与对象,数字和朋友不同。


糟糕的微软!


问候,


Aaron

In FF you can define the following ...

Element.prototype.getClass = function() { return this.className; /* or
whatever */ }
Element.prototype.setClass = function(c) { this.className = c; }

But it don''t work in IE.

Basically in IE land Element and Node are second class objects with no
prototypical behaviour, unlike Object, Number, and friends.

Bad Microsoft !

Regards,

Aaron

推荐答案

Aaron Gray写道:
Aaron Gray wrote:

在FF中你可以定义以下内容......


Element.prototype.getClass = function(){return this.className; / *

或其他* /}

Element.prototype.setClass = function(c){this.className = c; }


但它在IE中不起作用。


基本上在IE中,元素和节点是第二类对象,没有

原型行为,与对象,数字和朋友不同。


糟糕的微软!
In FF you can define the following ...

Element.prototype.getClass = function() { return this.className; /*
or whatever */ }
Element.prototype.setClass = function(c) { this.className = c; }

But it don''t work in IE.

Basically in IE land Element and Node are second class objects with no
prototypical behaviour, unlike Object, Number, and friends.

Bad Microsoft !



没有标准说W3C DOM定义的接口应该暴露构造函数和/或原型

(实际上可以很容易地认为

接口不应该有构造函数和/或原型。)


Richard。

No standard says that constructors and/or prototypes should be exposed
for W3C DOM defined interfaces (indeed it could easily be argued that
interfaces should not have constructors and/or prototypes).

Richard.


Richard Cornford < Ri ***** @ litotes.demon.co.ukwrote in message

news:g5 ******************* @ news .demon.co.uk ...
"Richard Cornford" <Ri*****@litotes.demon.co.ukwrote in message
news:g5*******************@news.demon.co.uk...

Aaron Gray写道:
Aaron Gray wrote:

>在FF你可以定义以下内容......

Element.prototype.getClass = function(){return this.className; / *或
无论什么* /}
Element.prototype.setClass = function(c){this.className = c;但是它不能在IE中工作。

基本上在IE中,元素和节点是没有原型行为的第二类对象,与Object不同,数量和朋友。

糟糕的微软!
>In FF you can define the following ...

Element.prototype.getClass = function() { return this.className; /* or
whatever */ }
Element.prototype.setClass = function(c) { this.className = c; }

But it don''t work in IE.

Basically in IE land Element and Node are second class objects with no
prototypical behaviour, unlike Object, Number, and friends.

Bad Microsoft !



没有标准说构造函数和/或原型应该暴露给
W3C DOM定义的接口(实际上可以很容易地认为

接口不应该有构造函数和/或原型)。


No standard says that constructors and/or prototypes should be exposed for
W3C DOM defined interfaces (indeed it could easily be argued that
interfaces should not have constructors and/or prototypes).



我的编程学校说你不应该设置障碍,而不需要b / b
,你只需要剥夺程序员和高级用户的权力。 />

Aaron

My school of programming says you should not put up barriers where none are
needed, you just disempower programmers and power users.

Aaron


7月12日下午5:49,Aaron Gray < ang.use ... @ gmail.comwrote:
On Jul 12, 5:49 pm, "Aaron Gray" <ang.use...@gmail.comwrote:

在FF中你可以定义以下内容......


Element.prototype.getClass = function(){return this.className; / *或

无论* /}

Element.prototype.setClass = function(c){this.className = c; }


但它在IE中不起作用。


基本上在IE中,元素和节点是第二类对象,没有

原型行为,与对象,数字和朋友不同。


糟糕的微软!
In FF you can define the following ...

Element.prototype.getClass = function() { return this.className; /* or
whatever */ }
Element.prototype.setClass = function(c) { this.className = c; }

But it don''t work in IE.

Basically in IE land Element and Node are second class objects with no
prototypical behaviour, unlike Object, Number, and friends.

Bad Microsoft !



如果您阅读ECMAScript标准,您将看到Host Objects

的行为与Native Objects的行为非常不同。


彼得

If you read the ECMAScript standard, you will see that Host Objects
can behave very differently than Native Objects.

Peter


这篇关于元素和节点是IE领域的二等公民的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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