page_title = encodeURIComponent(document.title); page_url = encodeURIComponent(document.URL); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("engage_div").innerHTML = this.responseText; } }; xhttp.open("post", "https://www.al-madina.org/engage/urls/add", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send("title="+page_title+"&url="+page_url);