Results 1 to 3 of 3
  1.    #1  
    Hey guys, well I'm trying to put more work into classes, but keep running into a problem. I can't put an AJAX call into a class. If I do, the command to run the method in the class gets called and immediately, the next command gets run, usually needing something that the AJAX call was getting.

    The AJAX calls only take about a second or so, but that's forever to a computer and my data never gets back in time.

    Is anyone else running AJAX calls in a class? Is there a way to wait for them, besides a while loop? I tried that, it didn't work.

    Thanks!

    David
  2. #2  
    you should append .bind(this) like so

    onSuccess: this.responseHandle.bind(this),

    or

    onSuccess function(){
    //code here
    }.bind(this)

    if you post some snippets it would be easier to explain.
  3. #3  
    I'm using Ajax calls inside a class, post what you've got and we'll figure out what's going wrong.
    My apps:
    ReWeather - Attractive weather app that reflects current conditions
    Suburbly UK (trial version) - Search for properties to rent, share or buy all over UK.

    Twitter: @joshsharp / @recursivemedia

Posting Permissions