Tagged version 1.1 of jQuery.
[jquery.git] / src / jquery / jquery.js
index 151f68f..e46fc73 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * jQuery @VERSION - New Wave Javascript
  *
- * Copyright (c) 2006 John Resig (jquery.com)
+ * Copyright (c) 2007 John Resig (jquery.com)
  * Dual licensed under the MIT (MIT-LICENSE.txt)
  * and GPL (GPL-LICENSE.txt) licenses.
  *
@@ -38,14 +38,14 @@ var jQuery = function(a,c) {
        
        // Handle HTML strings
        if ( typeof a  == "string" ) {
-               // HANDLE: $(html) -> $(array)
                var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
-               if ( m )
-                       a = jQuery.clean( [ m[1] ] );
+
+               a = m ?
+                       // HANDLE: $(html) -> $(array)
+                       jQuery.clean( [ m[1] ] ) :
                
-               // HANDLE: $(expr)
-               else
-                       return new jQuery( c ).find( a );
+                       // HANDLE: $(expr)
+                       jQuery.find( a, c );
        }
        
        return this.setArray(
@@ -122,11 +122,6 @@ var $ = jQuery;
  * This function also accepts XML Documents and Window objects
  * as valid arguments (even though they are not DOM Elements).
  *
- * @example $(document).find("div > p")
- * @before <p>one</p> <div><p>two</p></div> <p>three</p>
- * @result [ <p>two</p> ]
- * @desc Same as $("div > p") because the document
- *
  * @example $(document.body).background( "black" );
  * @desc Sets the background color of the page to black.
  *