jQuery.isWindow

// A crude way of determining if an object is a window
isWindow: function( obj ) {
  return obj && typeof obj === "object" && "setInterval" in obj;
}
Here is how it works:
1. it detects if there is an object being returned
2. it detects if the object type is object
3. it sees if setInterval is a method of the object, setInterval is part of window.setInterval, it’s a method that’s only available in window object.

你可能感兴趣的:(window,SetInterval)