首頁  >  工具  > $.isWindow(obj)

返回值:Boolean jQuery.isWindow(obj)

概述

測試對象是否是視窗(有可能是Frame)。

參數

obj Object V1.4.3

用於測試是否為視窗的對象

示例

描述:

測試是否為視窗

 

jQuery 程式碼:


<!DOCTYPE html>
<html>
<head>
  <script src="//code.jquery.com/jquery-1.5.2.js"></script>
</head>
<body>
  Is 'window' a window? <b></b>
<script>$("b").append( "" + $.isWindow(window) );</script>

</body>
</html>