snipplets.dev/snipplets/code/JavaScript/xhrPostForm.js
2023-08-05 22:45:06 +03:00

10 lines
252 B
JavaScript

let data = new FormData();
data.append('item_id', 1);
data.append('image_name', 'NAME');
let xhr = new XMLHttpRequest();
xhr.open('POST', '/v.php?type=image_delete', true);
xhr.onload = function() { console.log(this.responseText); };
xhr.send(data);