Guest User

Untitled

a guest
Nov 28th, 2018
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. var username = 'xx',
  2. password = 'xx';
  3.  
  4. var base64 = btoa(username + ":" + password);
  5.  
  6. $.ajax({
  7.  
  8. url: 'xx',
  9.  
  10. beforeSend: function(xhr) {
  11.  
  12. xhr.setRequestHeader('Authorization', 'Basic' + base64);
  13. }
  14.  
  15.  
  16.  
  17.  
  18. });
Add Comment
Please, Sign In to add comment