• $.extend()


    var result=$.extend({},{name:"Tom",age:21},{name:"Jerry",sex:"Boy"});

    合并后的结果为:

    result={name:"Jerry",age:21,sex:"Boy"};

    $.extend(hello:function(){alert('hello');});此语句的作用是把函数hello合并到jQuery的全局对象中。

    $.fn.extend(hello:function(){alert('hello');});将hello方法合并到jQuery的实例对象中

    $.extend({net:{}});在jQuery全局对象中扩展了一个net命名空间

    $.extend($.net,{hello:function(){alert('hello');}}); 将hello方法扩展到之前扩展的jQuery得net命名空间中去。

  • 相关阅读:
    Hibernate优缺点
    Struts优缺点
    Problem M
    Problem K
    Problem K
    Problem Q
    Problem Q
    Problem F
    Problem F
    哈夫曼树
  • 原文地址:https://www.cnblogs.com/oymx/p/3513388.html
Copyright © 2020-2023  润新知