Epoc

Untitled

Sep 22nd, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. By default, in cross-site XMLHttpRequest invocations, browsers will not send credentials. A specific flag has to be set on the XMLHttpRequest object when it is invoked.
  2.  
  3. C'est ce que j'ai fait :
  4.  
  5. $.ajax({
  6. type: 'POST',
  7. url: 'http://b.epoc.fr/jsonrpc.php',
  8. data: data,
  9. username: 'ahah',
  10. password: '415h6dfh12reh',
  11. xhrFields: {
  12. withCredentials: true
  13. },
  14. contentType: 'application/json',
  15. dataType: 'json',
  16. success: function(response) {
  17. console.log(response);
  18. },
  19. error: function(xhr, type) {
  20.  
  21. }
  22. });
  23. });
  24.  
  25. Toujours le même message d'erreur.
Advertisement
Add Comment
Please, Sign In to add comment