jQuery.isWindow()    **DEPRECATED 3.3** JQ Home  <<  Utilities  <<  jQuery.isWindow()

Window object detection.

Description

The jQuery.isWindow() jQuery Type utility method, returns a boolean dependant upon the specified argument being a window or not.

Shorthand version $.isWindow()

This method was deprecated in jQuery 3.3.

Syntax

Signature Description
jQuery.isWindow( object )Return a boolean dependant upon the specified argument being a window or not.

Parameters

Parameter Description Type
objectAn object to test to see if it is a window.PlainObject

Return

A Boolean object.

jQuery.isWindow( object ) Example Utilities  <<  Top

Return a boolean dependant upon the specified argument being a window or not.

In the example below when we press the button the first time we test some entities to see if they are window objects and output a message.


$(function(){
  $('#btn6').one('click', function(){
    $('#div6').append('Is window a window object? ' +  $.isWindow( window ) + '<br>');
    $('#div6').append('Is #div6 a window object? ' +  $.isWindow( '#div6' ) + '<br>');
  });
});

div6. Some initial text.

Press the button below to action the above code:

Related Tutorials

jQuery Intermediate Tutorials - Lesson 10 - jQuery Copy, Data & Type Utilities