how to refer "this Value of the SELECT component in javascript?

L

Lee

Lasse Reichstein Nielsen said:
If by "broken" you mean: will make a significant number of existing
pages break, then I'll have to agree. I wouldn't mind if the scope
chain hack was removed, though.

What I mean is that the methods and variables of the object
that is the execution context should always be included in
the current scope chain.
 
R

Richard Cornford

Lee said:
Lasse Reichstein Nielsen said:

What I mean is that the methods and variables of the object
that is the execution context should always be included in
the current scope chain.

I don't see the problem. If you want to access the properties of the -
this - object you have the - this - reference to use for the task. That
is specified and I am yet to hear of a browser where it doesn't work
(and if I do I will regard that browser as broken).

Otherwise the desire to use a non-standard, inconstant and not
universally implemented feature of web browsers is usually rendered non
error producing with feature detection, though the overhead in doing
that makes the use of the - this - keyword look like the simpler option.

Richard.
 
L

Lee

Richard Cornford said:
I don't see the problem. If you want to access the properties of the -
this - object you have the - this - reference to use for the task. That
is specified and I am yet to hear of a browser where it doesn't work
(and if I do I will regard that browser as broken).

My point is that you shouldn't have to specify "this" in this case.
I specify it most often just to make the intent more clear to
the person reading the code. The other valid uses are to pass
a reference to the current object or to distinguish between arguments
and object fields in a constructor.


Otherwise the desire to use a non-standard, inconstant and not
universally implemented feature of web browsers is usually rendered non
error producing with feature detection, though the overhead in doing
that makes the use of the - this - keyword look like the simpler option.


It works in all versions of IE, Netscape, Mozilla and Opera that
I've ever had installed. In which broken browser(s) do you need
to specify "this" to access the attributes of the object that is
the current execution context, or in which broken browser(s) is
the form element object not the execution context of its event
handler?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top