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>
  • 相关阅读:
    manage.py migrate 报错
    pip安装django出错 Could not install packages due to an EnvironmentError: [Errno 13]
    利用beautifulsoup下载网页html代码中的css, js, img文件并保存
    itchat库微信自动回复祝福语
    关于阿里云Mysql分页查询不走索引的问题
    如何成为PHP程序员?
    Linux常用命令之scp
    PHP版本的区别与用法详解
    Linux常用命令之ftp
    Linux常用命令之权限管理
  • 原文地址:https://www.cnblogs.com/abeen/p/700571.html
Copyright © 2011-2022 走看看