Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function(){
  2.     $('#init_sessao').click(login);
  3. });
  4.  
  5. $(function(){
  6.     $('#test_sessao').click(testLogin);
  7. });
  8.  
  9. function login(){
  10.  
  11.     $.ajax({
  12.         url: 'http://189.123.239.186:8080/cogecom/system/restful/testelogin',
  13.         type: 'GET',
  14.         xhrFields: {
  15.             withCredentials: true
  16.         },
  17.         crossDomain: true,
  18.         success: function(response, status, xhr){
  19.             alert(xhr.status);
  20.         },
  21.         error: function(response){
  22.             alert("response.status");
  23.         }
  24.     });
  25. }
  26.  
  27. function testLogin(){
  28.  
  29.     $.ajax({
  30.         url: 'http://189.123.239.186:8080/cogecom/system/restful/testesessao',
  31.         type: 'GET',
  32.         xhrFields: {
  33.             withCredentials: true
  34.         },
  35.         success: function(response, status, xhr){
  36.             alert(xhr.status);
  37.         },
  38.         error: function(response){
  39.             alert("response.status");
  40.         }
  41.     });
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement