Added support for multiple-namespaced events (in bind, trigger, and unbind).
[jquery.git] / src / core.js
index b731eb8..32e850f 100644 (file)
@@ -350,7 +350,7 @@ jQuery.fn = jQuery.prototype = {
        },
 
        hasClass: function( selector ) {
-               return this.is( "." + selector );
+               return !!selector && this.is( "." + selector );
        },
 
        val: function( value ) {
@@ -945,7 +945,7 @@ jQuery.extend({
                context = context || document;
 
                // !context.createElement fails in IE with an error but returns typeof 'object'
-               if ( context.createElement === undefined )
+               if ( typeof context.createElement === "undefined" )
                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
 
                jQuery.each(elems, function(i, elem){