Browse Source

check the existence of jQuery before adding iterator

Andy Li 10 years ago
parent
commit
1c17be9ea0
1 changed files with 2 additions and 1 deletions
  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);
 	}
 }