Ajax.Request egy osztályon belül
Szeretném segítségeteket kérni abban, hogy az alábbi kódot hogy kell módosítanom ahhoz, hogy a func2 metódusban lévő Ajax.Request-ben hogy tudom átvenni a már kiértékelt változókat.
■ - var jsClass = Class.create();
- jsClass.prototype = {
- initialize: function(p1, p2, p3){
- this.p1 = p1;
- this.p2 = p2;
- this.p3 = p3;
- this.func1();
- this.func2();
- },
- func1: function(){
- this.p4 = = this.p1 + this.p2 + this.p3;
- $('div_result').innerHTML = this.p4;
- }
- func2: function(){
- var a1 = new Ajax.Request('ajax.php', { method:'post',
- parameters: 'mode=p1&p1='+this.p1,
- onSuccess: function(transport){
- var p5 = transport.responseText;
- alert(p5>this.p4?true:false);
- // alert-ben a this.p4 értéke undefined, hogy tudnám áthozni ide a számított eredményt,
- // hogy tudjak vele értékelni?
- }
- });
- }
- }
bind a barátod
üdv Csaba
bind lesz a barátom
re
ui: a 18. sorban egy this van : kódszinező
bind lett a barátom