joris

Javascript Post Data

Mar 28th, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script language="javascript">
  2.     function CekLogin(){
  3.         $(document).ready(function(){
  4.         $("#login").submit( function (){
  5.         $.ajax({
  6.                type: "POST",
  7.                url : 'http://www.berthojoris.com/dev/jqm/login_cek.php',
  8.                data: {
  9.                   username:$('#username').val(),
  10.                   password:$('#password').val(),
  11.                },
  12.                dataType: "json",
  13.                success: function (data) {
  14.                     if (data.response=='SuksesLogin') {
  15.                         jAlert('Login Successfully', 'Success');
  16.                     } else {
  17.                         jAlert('Login Failed', 'Failed');
  18.                     }
  19.                 }
  20.       });
  21.     });
  22. });
  23. }
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment