Using JS Methods in jQuery
- by Wasabi
In the following code snippet, the String.fromCharCode is used, can all JS methods be used within jQuery?
Perhaps a noob question, but better to ask and prove a noob, then assume and be a fool.
// Invoke setBodyClass when a key is pressed
$(document).keyup(function(){
switch (String.fromCharCode(event.keyCode)){
case 'D':
setBodyClass('default');
break;
case 'N':
setBodyClass('narrow');
break;
case 'L':
setBodyClass('large');
break;
}
});//end keyup