How to use callback function in ajax when clicking on a link
<p>I am using jquery ajax when clicking on a link but i want to pass a usedefined function name from that link so that when i get results from ajax it should callback to the function i have passed . i am using this </p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
var call_me = function(data){
alert(data);
};
var  getmsg = function (val,callback) {
// alert(val+call_me);
$.ajax({
url : "send.php",
type : "post",
data : {value:val},
success : callback
})
}
&lt;/script&gt;
&lt;a href="#" onclick="getmsg($(this).html(),'call_me');"&gt;wewewe&lt;/a&gt;
</code></pre>