Skip to content

Instantly share code, notes, and snippets.

@marcmartino
Created June 7, 2012 22:40
Show Gist options
  • Save marcmartino/2892141 to your computer and use it in GitHub Desktop.
Save marcmartino/2892141 to your computer and use it in GitHub Desktop.
function attachEvent(el, action, callback){
if (el.addEventListener) {
el.addEventListener(action, callback, false);
} else if (el.attachEvent) {
el.attachEvent('on' + action, (function (ele) { return callback; })(el) );
}
}
inputKeyup: function (courseType){//event that's triggered on the input keyups
var currentRequest;
return function (e){
var currentThis = this;
if (this == window){ currentThis = ele; }
console.log("keyup");
console.log(currentThis);
var val = currentThis.value,
cachedValues = cachedServerResponses[currentThis.getAttribute("data-course-type")][val];
}
}
attachEvent(allInputs[m], "keyup", inputKeyup(thisAttr));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment