工具使用:

 

 1var Person = Class.create();
 2Person.prototype ={
 3    initialize:function(){
 4        this.name="BOY";
 5    }
,
 6    GetName:function(){
 7        alert(this.name);
 8    }
,
 9    AjaxQuestion:function(){
10        var option={
11            method:"get",
12            parameters:"",
13            onSuccess:function(transport)
14               alert("hello1");  
15                this.GetName();    // 这里没反应            
16                alert("hell02");
17            }
,
18            onFailure:function(transport){
19                alert("Failure");
20            }

21        }

22        var request= new Ajax.Request("ajax.aspx",option);
23    }

24}

25// 调用
26var ps = new Person();
27  ps.GetName();
28  ps.AjaxQuestion();
posted on 2006-12-08 10:54  tenero  阅读(2084)  评论(2编辑  收藏  举报