i have this
<a onclick="$('.element').hide(0); doMyMethod(_element = $(this));"></a>
doMyMethod() is an ajax request, what i would like is to pass a callback when this method is finished i would like to alert('somenthing');
so i tryed with no chance:
<a onclick="$('.element').hide(0,function(){doMyMethod(_element = $(this)); }, function(){ alert('somenthing');}); "></a>
does anyone can help me?
you need to pass your alert(‘something’) method to doMyMethod which should pass it to jquery’s ajax as the callback.
Since your click is getting complicated, you may move it to it’s own function.
pass the callback as the “complete” callback http://api.jquery.com/jQuery.ajax/