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?
$.postis a shorthand for$.ajaxwith certain presets (api.jquery.com/jQuery.post). From the code it should be calling thesearchpcp.phpproperly, but why do you pass thepcpmnumas a string instead of passing its value (without the quotes and the +es)?