jQuery.isWindow()S2C 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()

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 ) Examplego to top of page 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:


go to home page Homepage go to top of page Top