Advertisement
Guest User

Update

a guest
Nov 24th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Foo = function(){
  2.     this.stage = 0;
  3. };
  4.  
  5. Foo.prototype.bar(){
  6.     $.ajax({
  7.         url:          url,
  8.         data:         {'stages': this.stage},
  9.         type:         'GET',
  10.         dataType:     'html',
  11.         contentType:  'application/json',
  12.         success:      function(data) {
  13.             //use data
  14.         },
  15.         error:       function(xhr, testStatus, error) {
  16.             console.log("Error occured: "+error+" "+xhr+" "+testStatus);
  17.         }
  18.     });
  19.     this.stage++;            //doesn't work
  20.     console.log(this.stage); //this works
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement