if ( events ) {
// Unbind all events for the element
- if ( !types )
+ if ( types == undefined )
for ( var type in events )
this.remove( elem, type );
else {
data.shift();
// Handle triggering of extra function
- if ( extra ) {
+ if ( extra && jQuery.isFunction( extra ) ) {
// call the extra function and tack the current return value on the end for possible inspection
var ret = extra.apply( elem, data.concat( val ) );
// if anything is returned, give it precedence and have it overwrite the previous value