Javascript examples for jQuery Method and Property:ajax
Sending and returning data with ajax
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> </head> //from w w w .j a v a2 s. c om <body> <form> <input type="text" name="username" value="" class="authcheck"> </form> <script type="text/javascript"> $(document).on('keyup', 'input', function(){ var inputVal = $('input').val(); $.post('auth.php', { 'username' : inputVal }, function(data){ console.log(inputVal +' is '+ data); }); }); </script> </body> </html>