You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.2 KiB

  1. console.log("Favoriting with token: " + quill_token);
  2. var http = new XMLHttpRequest();
  3. var params = "like-of=" + encodeURIComponent(window.location) + "&token=" + quill_token;
  4. http.open("POST", "http://quill.dev/favorite", true);
  5. http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  6. http.onreadystatechange = function() {//Call a function when the state changes.
  7. console.log(http);
  8. if(http.readyState == 4 && http.status == 200) {
  9. alert(http.responseText);
  10. }
  11. }
  12. http.send(params);
  13. /*
  14. (function(){var el=document.createElement('input'); el.type="hidden"; el.id="quill_token"; el.value="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMjciLCJtZSI6Imh0dHA6XC9cL2Fhcm9ucGFyZWNraS5jb20iLCJjcmVhdGVkX2F0IjoxNDEwMTE3NTM5fQ.ifp1VIgCTz9NPtMTlTLPBXAGSxHwpGS5tLPhXGxrjNk"; document.body.appendChild(el); document.body.appendChild(document.createElement('script')).src='http://quill.dev/js/fav.js';})();
  15. (function(){document.body.appendChild(document.createElement('script')).src='http://quill.dev/favorite.js?url='+encodeURIComponent(window.location)+'&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMSIsIm1lIjoiaHR0cDpcL1wvcGsuZGV2XC8iLCJjcmVhdGVkX2F0IjoxNDE5MDM2NzAzfQ.AgJ5xyviiBzWOvQO0je0Bdi3BUpKJ4CLJnx8GIm-0OI';})();
  16. */