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();
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();