Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. // ==UserScript==
  2. // @name aliexpress
  3. // @version 1
  4. // @grant none
  5. // ==/UserScript==
  6. setTimeout(function(){
  7. var x = document.getElementsByClassName("main-title");
  8. x[0].innerHTML = x[0].textContent + '<hr><button id = "mercadoflowbtn" name="button" onclick="comentario()" class = "andes-button andes-button--filled sc-action-button andes-button--small">Copiar Informações</button>';}, 3000);
  9.  
  10. function comentario()
  11. {
  12.  
  13. var ajax = new XMLHttpRequest();
  14.  
  15.  
  16. // Seta tipo de requisição: Post e a URL da API
  17.  
  18. ajax.open("POST", "https://ilogisticsaddress.aliexpress.com/ajaxSaveOrUpdateBuyerAddress.htm", true);
  19.  
  20. ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  21.  
  22. var postaliexpress = "_csrf_token_=j_x71i_9z_y5&phoneCountry=%2B1&contactPerson=teas&mobileNo=123213&address=1231&address2=123&zip=12124&country=US&province=Alaska&city=Akhiok&features=%7B%22ruPassport%22%3A%22taxNumber%22%2C%22locale%22%3A%22en_US%22%7D&shipcompany=EMS_ZX_ZX_US&useLocalAddress=true";
  23. // Seta paramêtros da requisição e envia a requisição
  24.  
  25. //ajax.send("view=detail&rowId=" +codmercado + "&content='{'note':'teste'}");
  26. ajax.send(postaliexpress);
  27.  
  28. // Cria um evento para receber o retorno.
  29.  
  30. ajax.onreadystatechange = function() {
  31.  
  32.  
  33.  
  34. // Caso o state seja 4 e o http.status for 200, é porque a requisiçõe deu certo.
  35.  
  36. if (ajax.readyState == 4 && ajax.status == 200) {
  37.  
  38.  
  39.  
  40. var data = ajax.responseText;
  41.  
  42.  
  43. // Retorno do Ajax
  44.  
  45. console.log(data);
  46.  
  47. }
  48.  
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement