I have control that I render throw ajax and append it to div in the document:
function RevrievePopUpViaAjax(url) {
if (document.getElementById('abcd') == null) {
var jqxhr = $.ajax({
url: url,
type: "GET"
})
.done(function (data) {
$("#contentDiv").append(data);
})
.fail(function () {
alert("error");
})
}
else {
abcd.PerformCallback();
}
}
This is my original function in the first time I call it, it renders control with id 'abcd' when I call it the second time there is a difference between document.getElementById('abcd') that return null and shows like the element doesn't exists although it is really do exist to window.abcd that not return null and shows that the element do exists...
It probably my misunderstand of something... someone can explain it to me?