function _ajax(url, data, callback) { var xhr=new XMLHttpRequest() , resp; this.xhr=xhr; xhr.open('POST', url, true); xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8'); xhr.send(JSON.stringify(data)); xhr.responseType = 'text'; xhr.onreadystatechange = function () { if (xhr.readyState !== 4) { return; } try { resp = JSON.parse(xhr.responseText); } catch (e) { console.log(xhr.responseText); resp = xhr.responseText; } if (xhr.status === 200) { if (callback) { callback(resp); } else { return resp; } } }; } var url='https://crossbase.ru/prim/getjs/gettable.php?n=1Z0035411A&lang=ru&cartype=LEG'; document.querySelector('#applicability_widget').innerHTML="

Применяемость 1Z0035411A загружается
"; _ajax(url,{},function (resp){ document.querySelector('#applicability_widget').innerHTML=resp; });