function commentNewShow() {
var formData = new FormData();
formData.append('Url', '@url');
formData.append('UrlName', '@title');
var xhr = new XMLHttpRequest();
xhr.open("POST", '/Comments/NewForm', true);
xhr.send(formData);
xhr.onreadystatechange = function (e) {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
var commentNew = document.getElementById('commentNew');
commentNew.innerHTML = xhr.responseText;
} else {
alert('Возникла ошибка. Попробуйте позже.');
}
}
};
}
commentNew.innerHTML = xhr.responseText;
var scripts = commentNew.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
eval(scripts[i].innerText);
}