Nicolas Cannasse 10 年之前
父節點
當前提交
1bb6730263
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      std/js/JQuery.hx

+ 5 - 4
std/js/JQuery.hx

@@ -65,10 +65,11 @@ typedef JqEvent = {
 extern class JQueryHelper {
 	@:overload(function(j:JQuery):JQuery{})
 	@:overload(function(j:DOMWindow):JQuery{})
-	@:overload(function(j:Element):JQuery{})
-	public static inline function J( html : String ) : JQuery {
-		return new JQuery(html);
-	}
+	@:overload(function(j:Element):JQuery { } )
+
+	public static inline function J( html : haxe.EitherType<String,haxe.EitherType<JQuery,haxe.EitherType<DOMWindow,Element>>> ) : JQuery {
+        return new JQuery(cast html);
+    }
 
 	public static var JTHIS(get, null) : JQuery;