"Robert Mark Bram" <relaxedrob@remove.this.optusnet.com.au> writes:
[color=blue]
> function one()
> {
> // "this" would refer to a TestObject (~1~)[/color]
Correct.
[color=blue]
> // Make a select control.. and assign it an onChange handler.
> var dateSelect = document.createElement ("select");[/color]
Add:
var thisTestObject = this;
to get a variable as reference to the testObject, instead of just
"this".
[color=blue]
> dateSelect.onchange =
> function hide()
> {
> // "this" refers to a Select object.[/color]
Correct.
[color=blue]
> // How can I refer to the TestObject at (~1~) so I can
> // call two() on that particular instance?[/color]
Use the variable "thisTestObject". The function expresion "hide"
creates a closure, so it remembers the value of the "thisTestObject"
variable.
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'