function funcBefore () { $("#wait").show(); } $(document).ready (function () { $("#token").bind("input", function () { $.ajax ({ url: "/data/api/tokenQuery.php", type: "POST", data: ({token: $("#token").val()}), dataType: "html", beforeSend: funcBefore, success: function (data) { $("#wait").hide(); $("#info").html (data); } }); }); })