zoukankan      html  css  js  c++  java
  • [JavaScript] JavaScript AjAX 面向对象

    代码摘自Jeffrey Zhao的Demo
    <script language="javascript" type="text/javascript">
            Type.registerNamespace(
    "AspNetAjaxOverView");
            
            AspNetAjaxOverView.Person 
    = function(firstName, lastName)
            {
                
    this._firstName = firstName;
                
    this._lastName = lastName;
            }
            AspNetAjaxOverView.Person.prototype 
    =
            {
                get_firstName : 
    function()
                {
                    
    return this._firstName;
                },
                get_lastName : 
    function()
                {
                    
    return this._lastName;
                },
                toString : 
    function()
                {
                    
    return String.format("Hello, I'm {0} {1}.",
                        
    this.get_firstName(),
                        
    this.get_lastName());
                }
            }
            AspNetAjaxOverView.Person.registerClass(
    "AspNetAjaxOverView.Person");
            
            AspNetAjaxOverView.Employee 
    = function(firstName, lastName, title)
            {
                AspNetAjaxOverView.Employee.initializeBase(
    this, [firstName, lastName]);
                
                
    this._title = title;
            }
            AspNetAjaxOverView.Employee.prototype 
    =
            {
                get_title : 
    function()
                {
                    
    return this._title;
                },
                toString : 
    function()
                {
                    
    return AspNetAjaxOverView.Employee.callBaseMethod(this"toString"+
                        
    " My title is '" + this.get_title() + "'.";
                }
            }
            AspNetAjaxOverView.Employee.registerClass(
    "AspNetAjaxOverView.Employee", AspNetAjaxOverView.Person);
        
    </script>
  • 相关阅读:
    元学习Meta Learning/Learning to learn
    TRAINING A CLASSIFIER训练分类器(pytorch官网60分钟闪电战第四节)
    NEURAL NETWORKS神经网络(pytorch官网60分钟闪电战第三节)
    AUTOGRAD: 自动分化(pytorch官网60分钟闪电战第二节)
    WHAT IS PYTORCH?(pytorch官网60分钟闪电战第一节)
    windows找不到gpedit.msc
    The “freeze_support()“ line can be omitted if the program is not going to be frozen to produ
    torch.mul() 和 torch.mm() 的区别
    vue面试题(2)
    JS输出题练习
  • 原文地址:https://www.cnblogs.com/abeen/p/700571.html
Copyright © 2011-2022 走看看