... $("#send").click(function(){ $.ajax({ type: 'POST', url: 'process.pl?first=&last=', dataType: "json", success: function(data) { if(data){ alert("We pass!"); } }, error: function() { alert("We have a problem!"); } }); }); ...