This is the jQuery code
success: function (html) {
var text = $(html).text();
if (text == '') {
location.reload();
} else {
$("#warning2").html(html);
}
}
What I want is to convert $(html).text();
to plain JavaScript
Here is my plain JavaScript code but the page will not reload unlike jQuery code.
xhttp.onreadystatechange = function()
{
if (xhttp.readyState == 4 && xhttp.status == 200)
{
if (xhttp.responseText == "" || xhttp.responseText.textContent == "")
location.reload();
else
document.getElementById("warning2").innerHTML = xhttp.responseText;
}
};