Guest User

Untitled

a guest
Jun 24th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.      
  3.       $("#submit").click(
  4.      
  5.         function(){
  6.        
  7.             var username=$("#username").val();
  8.             var password=$("#password").val();
  9.             //DIV DEL LOADING
  10.             $("#form_message").empty().html('<img class="loadimg-login" src="'+base_url+'assets/images/loading.gif" />');
  11.            
  12.             $.ajax({
  13.             type: "POST",
  14.             url: base_url+"index/login",
  15.             dataType: "json",
  16.             data: "username="+username+"&password="+password,
  17.             cache:false,
  18.             success:
  19.  
  20.               function(data){
  21.                 if (data.message == 'OK') {
  22.                     window.location.href = data.access;
  23.                 }
  24.                 $("#form_message").html(data.message).css({'background-color' : data.bg_color}).fadeIn('slow');
  25.               }
  26.            
  27.             });
  28.    
  29.           return false;
  30.  
  31.         });
  32.      
  33.  
  34.     });
Add Comment
Please, Sign In to add comment