Log in

View Full Version : This.getXY is not a function


sonicseaweed
Aug 15, 2009, 01:09 PM
So I'm working on this script and I get an error I cannot understand. The script it complicated (800+ lines), but here is what it boils down to


var someNamespace = {

getXY : function(event) {
// do some stuff
}

where_Am_I : function(event) {
// get coordinates
this.getXY(event);
// do stuff...
}

start_process : function(event) {
this.where_Am_I(event);
document.getElementById('foo').onmousemove = this.where_Am_I;
}

};


Start_process is the function that is called. The first call to getXY works fine, but then I get a "is not a function" error from Firefox and a type error from opera when I move my mouse. Notice that where_Am_I is still being registered as a function, but getXY that is called from within it complains..

Any ideas?