Can anyone please point me in the right direction? I am new to AJAX.
I want to add the ID of a post to this simple request.
Anyone? Thanks Martin
<!DOCTYPE html>
<html>
<body>
<h1>Postback to webhook incl PostID</h1>
<button type="button" onclick="loadDocs()">Postback</button>
<p id="testID"></p>
<script>
function loadDocs() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("testID").innerHTML = this.responseText;
}
};
xhttp.open("POST", "https://hook.integromat.com/h17qasnzptr4lo7cs6br1vmrv28t11ji", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("url=POSTIDHERE");
}
</script>
</body>
</html>