Здравстсвуйте необходимо заставить работать данный код. Причина мне кажется в том что скрипт который подгружается аяксом не видит обект который ему надо изменять.
Код подгружающий:
<script>
function getAXAH(url,elementContainer) {
var theHttpRequest = false;
try {
theHttpRequest = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
theHttpRequest = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {
theHttpRequest = new XMLHttpRequest();
}
}
theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};
theHttpRequest.open("GET", url);
theHttpRequest.send(false);
function processAXAH(elementContainer){
if (elementContainer!='status')
{
if (theHttpRequest.readyState == 4) {
if (theHttpRequest.status == 200) {
//document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
insertText(theHttpRequest.responseText);
} else {
alert('Данные недоступны!');
}
}
}
}
}
function insertText(text) {
document.getElementById('text').innerHTML = text;
var result = text.match(/<script>(.*)<\/script>/im);
if(result) eval(result[1]);
}
setInterval("getAXAH('go.php');", 3000);
</script>
<div id="text"></div>
и подгружаемый код:
Ля ля ля ля ля ля <br />
<span id='ti'>15</span>
<script>var d = document.getElementById('ti'); setInterval('d.innerText--;', 1000);</script>
<br />Ля ля ля ля ля ля
Из этого мы видим что нужно сделать чтоб счетчик на странице отсчитывал время.