• JS,JQuery的扩展方法


    转 http://blog.csdn.net/tuwen/article/details/11464693 

    //JS的扩展方法: 1 定义类静态方法扩展 2 定义类对象方法扩展
                var aClass = function(){}


                //1 定义这个类的静态方法
                aClass.sayHello = function(){
                    alert('say hello');
                }


                //2 定义这个类对象的对象方法
                aClass.prototype.protoSayHello = function(){
                    alert('prototype say hello');
                }




                aClass.sayHello() ;//aClass的静态方法


                var aObject = new aClass();
                aObject.protoSayHello();  //类对象的方法扩展


                //JQuery的方法扩展


                //定义jquery的扩展方法
                //1 定义JQuery的静态方法
                jQuery.extend({
                    staticHello: function () {
                        alert("wwg, staticHello");
                    }
                });


                var str = $.staticHello();


                //2 定义JQuery对象的扩展方法
                jQuery.fn.ObjHello = function () {
                    return alert("ObjHello");
                }


                $("#htmlDiv").ObjHello();

    开源代码

     www.codeplex.com
    www.codeproject.com 
    github
  • 相关阅读:
    FOAT、SOAT、OAT
    autosar mcal之启动代码
    华为2020操作系统相关链接openeuler
    CCP/XCP
    autosar资料(持续更新。。。)
    liteos相关源码资料
    autosar学习之通信栈
    Autosar COM层发送模式选择(信号发送属性和I-PDU发送模式)
    统一诊断服务 (Unified diagnostic services , UDS)
    Linux路由器及交换机工作原理
  • 原文地址:https://www.cnblogs.com/zhaowei303/p/4989175.html
Copyright © 2020-2023  润新知