If I call the killSwitch() outside the onkeypress, I ll cause an error. But inside the onkeypress function, I worked just fine. Why?
www.un.org/Depts/DGACM/index_spanish.htm
// this works fine
var ClassA = function()
{
var doc = document;
// killSwitch();
doc.onkeypress = function(e){ killSwitch(); }
this.killSwitch = function(){ alert( hello world ); }
}
var myClass = new ClassA();