最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery.isFunction()

jQuery.isFunction( obj ) 返回: boolean

描述: 確定的參數(shù)是一個Javascript 函數(shù)。

  • version added: 1.2jQuery.isFunction( obj )

    obj用于測試是否為函數(shù)的對象

注意:jQuery 1.3以后,在IE瀏覽器里,瀏覽器提供的函數(shù)比如alert()還有 DOM 元素的方法比如 getAttribute() 將不認為是函數(shù)。

Examples:

Example: Test a few parameter examples.

<!DOCTYPE html>
<html>
<head>
  <style>
  div { color:blue; margin:2px; font-size:14px; }
  span { color:red; }
  </style>
  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  
  <div>jQuery.isFunction(objs[0]) = <span></span></div>

  <div>jQuery.isFunction(objs[1]) = <span></span></div>
  <div>jQuery.isFunction(objs[2]) = <span></span></div>
  <div>jQuery.isFunction(objs[3]) = <span></span></div>

  <div>jQuery.isFunction(objs[4]) = <span></span></div>
  
<script>
    function stub() {
    }
    var objs = [
          function () {},
          { x:15, y:20 },
          null,
          stub,
          "function"
        ];

    jQuery.each(objs, function (i) {
      var isFunc = jQuery.isFunction(objs[i]);
      $("span").eq(i).text(isFunc);
    });
</script>

</body>
</html>

Demo:

Example: Finds out if the parameter is a funcion.

$.isFunction(function(){});

Result:

true
jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
五常市| 峨山| 高要市| 丹寨县| 象州县| 云林县| 衡阳市| 修武县| 碌曲县| 渭源县| 通州区| 沅陵县| 福鼎市| 安陆市| 博爱县| 靖江市| 凌云县| 布拖县| SHOW| 龙江县| 通河县| 中宁县| 临洮县| 屯昌县| 托克逊县| 卫辉市| 长泰县| 荥经县| 旺苍县| 桂东县| 木里| 安康市| 黎平县| 乌审旗| 治县。| 措勤县| 姚安县| 铜川市| 石首市| 吉林省| 绵阳市|