瀏覽代碼

check the existence of jQuery before adding iterator

Andy Li 10 年之前
父節點
當前提交
1c17be9ea0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      std/js/jquery/JqIterator.hx

+ 2 - 1
std/js/jquery/JqIterator.hx

@@ -15,6 +15,7 @@ class JqIterator {
 	}
 
 	static function __init__() {
-		JQuery.fn.iterator = function() return new JqIterator(js.Lib.nativeThis);
+		if (untyped __typeof__(JQuery) != "undefined" && JQuery.fn != null)
+			JQuery.fn.iterator = function() return new JqIterator(js.Lib.nativeThis);
 	}
 }