function test(options){
            $.extend({ },this.Default,options);
    
            var v = this.Default || options;
            alert(v.name);//传入打印'嘻嘻嘻嘻',不传入打印'呵呵呵'
        }   
        test.prototype.Default = {
         name:'呵呵呵'
        };
        new test({name:'嘻嘻嘻嘻'});
     //js可传入对象,也可不传入,不传入时使用默认
 
 
function test1(options){
         var defaults = { name: "foo" };
            $.extend({ },defaults,options);
    
            var v = defaults || options;
            alert(v.name);//传入打印'嘻嘻嘻嘻',不传入打印'呵呵呵'
        }   
        new test1({name:'ssss'});

随机推荐

  1. 【CV论文阅读】Two stream convolutional Networks for action recognition in Vedios

    论文的三个贡献 (1)提出了two-stream结构的CNN,由空间和时间两个维度的网络组成. (2)使用多帧的密集光流场作为训练输入,可以提取动作的信息. (3)利用了多任务训练的方法把两个数据集联 ...

  2. python-pexpect_02ssh

    #!/usr/bin/env python """ This runs a command on a remote host using SSH. At the prom ...

  3. Ubuntu12.04LTS 安装 eclipse

    首先安装JDK,参考:Ubuntu12.04.3LTS安装Oracle Java 7 然后安装eclipse: 安装方法一:通过命令行/Software Center下载Ubuntu源中的Eclips ...

  4. 自然常数 e 的理解与应用

    某彩票中奖率是百万分之一,则一个人买一百万张彩票仍不中奖的概率是: (1−1106)106≈1e e 往往出现在: 许多微小事件带来的总体变化 随机性和无穷多:

  5. codeforces 764D

    脑洞 很早以前没有补掉的题目 四色问题肯定使有解的,然后就是怎么构造.注意到边长是奇数,那么我们就可以分类,按左上角坐标的奇偶性分类,正好对应四种颜色.因为当两个矩形左上角横纵坐标奇偶性不同时,那么肯 ...

  6. 可写可选dropdownlist(只测试过ie)

    页面: 报废申请人:<asp:TextBox ID="txtPUSER" runat="server" Width="70px" Cs ...

  7. vue项目打包之后首页白屏的问题

    本地的vue项目在server端浏览没问题,但是执行npm run build 打包之后在本地预览是白屏. 解决方法 1.路径问题 在config文件夹中找到index.js打开把assetsPubl ...

  8. php获得两个字符串公共最大子串的函数

    <?php header("Content-type: text/html; charset=utf-8"); function search($str1,$str2) { ...

  9. CentOS 7.0 firewall防火墙关闭firewall作为防火墙,这里改为iptables防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤: 1.先检查是否安装了: iptables service iptables status 2.安装ip ...

  10. 354 Russian Doll Envelopes 俄罗斯娃娃信封

    You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envel ...