Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing success callback call #2

Closed
LoneCoder opened this issue Oct 12, 2011 · 4 comments
Closed

Missing success callback call #2

LoneCoder opened this issue Oct 12, 2011 · 4 comments

Comments

@LoneCoder
Copy link

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

@kolyuchiy
Copy link
Member

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

@LoneCoder
Copy link
Author

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

@kolyuchiy
Copy link
Member

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

@LoneCoder
Copy link
Author

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants