jquery--工具插件

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>可以给jq用也可以给js用</title>
    <style>
    .dl{width: 100px; height: 100px; background: yellow;}
    </style>
    <script src='../jquery-3.1.1.min.js'></script>
    <script>
    $(function(){
        var  a='hellow';
        var  b=new Date;
        var  c='  arrt  ';
        var  arr=['a','b','c','b','d',];
        //$.type();判断类型比typeof用处广;能判断new出来的对象属性;
        console.log($.type(a));
        console.log($.type(b));

       //trim()可以去除空格
        console.log($.trim(c));

        // inArray()类似于indexof; 获取index;
        console.log($.inArray('c',arr));

        // proxy(); 改变this指向;
/*        function show(fn1,fn2){
             alert(fn1);
             alert(fn2);
            alert(this);
        }
        
      $(document).click($.proxy(show,window,3,4));
     })
      */


    </script>
</head>
<body>
    <div class="dl"></div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/u012138854/article/details/109590796