$.ajax({
type: 'POST',
url: 'default.php',
data: "q="+myform.serialize(),
success: function(data){
// use return data on success
},
error: function(xhr, type, exception) {
// display error alert, if ajax fails
alert("ajax error response type "+type);
}
});