I am sending data through jquery. my equivalent code is…
$('#pcpmnum').blur(function(){
//alert("HIiiiiii");
var pcpmnum = $("#pcpmnum").val();
if(pcpmnum === "" | pcpmnum === null)
{
alert("Please Enter Mobile Number");
}
else
{
alert(pcpmnum);
$.post("searchpcp.php", {cntctnumber: "+pcpmnum+"}, function(){
alert("Success");
}
}
});
on my php file I have simply used.
echo "HIIII";
Is this $.post function is equivalent to Ajax function?
simply do
and in the php file you can get the value as
in the success call back the argument
datain your case contains the server response e.g. in you php file you are echoingon the client side
datawill be holding this responsehere are some useful links
jQuery, Ajax, Json and Php
Returning JSON from PHP to JavaScript?