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...
精彩评论