Advertisement
Guest User

Untitled

a guest
Jul 27th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function rpost(url, content_type, body) {
  2.     let xhr = new XMLHttpRequest();
  3.     xhr.open('POST', url, false);
  4.     xhr.setRequestHeader('content-type', content_type);
  5.     xhr.send(body);
  6.     return xhr.responseText;
  7. }
  8.  
  9. function add_bookmark(id, tags, isPrivate) {
  10.     let token = '',
  11.     data = rpost('/ajax/illusts/bookmarks/add',
  12.                 'application/json;charset=utf-8',
  13.                 JSON.stringify({ comment: "", illust_id: id, restrict: isPrivate, tags: tags })
  14.            );
  15.     new_win.console.log('RES: ' + data);
  16. }
  17.  
  18. //add_bookmark('00000000', ['simple','text'], false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement