function checkTime() { $.ajax({ type: "GET", url: "../xml.php?action=checktime&time="+ $("#date").val(), dataType: "xml", beforeSend: function (request) { $("#strtotime_output").html("Checking..."); }, success: function (xml) { if ($("response > time", xml).attr("valid") == 0) $("#strtotime_output").html("This time is not valid."); else $("#strtotime_output").html($("response > time", xml).attr("time")); }, }); }