O
Olumide
I need to swap the onclick method bound to a layer (nLayer). The
assignment,
document.getElementById('nLayer').onclick = nullScript; // OK
works when the method bound (i.e. nullScript) requires no arguments.
However, when the method to be bound (i.e. activeScript) DOES require
an argument as show below,
document.getElementById('nLayer').onclick = activeScript(1); // ERROR
my browser (IE6.0) reports an error. Is this the correct way to
perform the such an assignment?
////// Function Declarations /////
function nullScript(){
//DO STUFF
]
function activeScript(var number){
//DO SOMETHING ELSE
]
/////////////////////////////////
ThanX
- Olumide
assignment,
document.getElementById('nLayer').onclick = nullScript; // OK
works when the method bound (i.e. nullScript) requires no arguments.
However, when the method to be bound (i.e. activeScript) DOES require
an argument as show below,
document.getElementById('nLayer').onclick = activeScript(1); // ERROR
my browser (IE6.0) reports an error. Is this the correct way to
perform the such an assignment?
////// Function Declarations /////
function nullScript(){
//DO STUFF
]
function activeScript(var number){
//DO SOMETHING ELSE
]
/////////////////////////////////
ThanX
- Olumide