var serviceUrl = document.currentScript.getAttribute('serviceurl'); var siteId = document.currentScript.getAttribute('siteid'); var postId = document.currentScript.getAttribute('postid'); var remark42Host = document.currentScript.getAttribute('remark42host'); function ajax(url) { return new Promise(function (resolve, reject) { var xhr = new XMLHttpRequest(); xhr.onload = function () { resolve(this.responseText); }; xhr.onerror = reject; xhr.open('GET', url); xhr.send(); }); }