Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Missing success callback call #2

Closed
LoneCoder opened this Issue · 4 comments

2 participants

LoneCoder Nikolay Morev
LoneCoder

Hi,
I think success callback is not saved in the object

$this.append(markup);
if (typeof success == 'function') {
setTimeout(success, 0);
}

when the method looks for the function, it's is out of scope,
so success cannot be called

Nikolay Morev
Owner

Hi,
Thanks for the bug report. Please try the updated version.

LoneCoder

Hi,
thanks for the quick fix, it works well now.
May i suggest to replace

setTimeout(success, 0);

with

setTimeout(function (){success.call($this);}, 0);

so we are able to pass the affected element to callback via this ?

bye

Nikolay Morev
Owner

Yes, of course. It's a good suggestion.
I've updated the code.

LoneCoder

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.