开发者

Using JQuery $.proxy() to handle $.post() callback with this context

开发者_StackOverflow中文版

I tried to encapsulate $.post() to an object and handle the callback using the object's method/function. The net suggest that I should use JQuery $.proxy() to achieve it like question. However it seems that jquery (or me) is failing to get the right context.

Here is a live demo http://jsfiddle.net/komaruloh/WSBBC/


You're doing it right. The context is preserved inside this.display. Try to log "this".

http://jsfiddle.net/WSBBC/1/

Maybe something is wrong with the PHP file...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜