jQuery.isWindow(obj)
version 1.4.3 以降
解説
引数が、Windowオブジェクトかどうかを判別します。
引数
戻り値
-
Boolean: Windowオブジェクトの場合は
true 、それ以外の場合はfalse
例
例1:様々な引数を指定し、結果を確認します。
var i = 0;
$.each([window, document], function(key, value) {
var res = $.isWindow(value);
$("#test_result table tr").eq(i++)
.append($("<td>", {css: { "fontWeight": res ? "bold" : "normal" }}).text(res));
});
$.isWindow(window) |
$.isWindow(document) |
|