Advertisement
pushtook

js ajax

Nov 19th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Created by eyalb on 13/11/2017.
  3.  */
  4.  
  5.  
  6. jQuery(function($){
  7.     $(document).ready(function(){
  8.  
  9.  
  10.         $('#pu-form').submit(function(e) {
  11.             e.preventDefault();
  12.             var username = $('#username').val();
  13.             var password = $('#password').val();
  14.             var customer_id = $('#customer_id').val();
  15.             var location = $('#location').val();
  16.  
  17.             $.ajax({
  18.               url: 'http://212.235.34.9/tzviCohenSite/WebService.asmx/erpSite_getIsUserExist',
  19.               headers: {
  20.                 "cache-control": "no-cache",
  21.                 "content-type": "application/x-www-form-urlencoded;charset=\"utf-8\""
  22.               },
  23.               type: 'POST',
  24.               dataType: 'json',
  25.               data: {
  26.                 UserName: username,
  27.                 Password: password,
  28.                 CustomerId: customer_id,
  29.                 cmpId: location
  30.               },
  31.             })
  32.             .done(function() {
  33.               console.log("success");
  34.             })
  35.             .fail(function() {
  36.               console.log("error");
  37.             })
  38.             .always(function() {
  39.               console.log("complete");
  40.             });
  41.            
  42.            
  43.         });
  44.     })
  45. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement