Друзья, пожалуйста, помогите найти ошибку в коде.
<script type="text/javascript" src="libs/windows.js"></script>
<script type="text/javascript" src="libs/ajax.js">
function changeStatus()
{
var req = getXmlHttp()
var statusElement = document.getElementById("user_status")
var userStatus = document.user_status.value
req.onreadystatechange = function() {
if (req.readyStatus == 4) {
statusElement.innerHTML = req.responseText;
}
}
req.open("POST", "/libs/changestatus.php", true);
req.send("status=" + userStatus);
statusElement.innerHTML = "Загрузка..."
}
</script>
window.js:
function window_Status() {
document.getElementById("winstatus").setAttribute("style", "display: block;");
}
ajax.js:
function getXmlHttp(){
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}