Hi,

I am using two almost same scripts in the same page. Here is the all script:

PHP Code:
<body>
<
div id="header2"
asd 
</div
<!-- 
pradzia --> 
<
script language="javascript" type="text/javascript"
<!--  
// Get the HTTP Object 
function gethttpObject(){ 
   if (
window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); 
   else if (
window.XMLHttpRequest) return new XMLHttpRequest(); 
   else { 
      
alert("Your browser does not support AJAX."); 
      return 
null
   } 
}    
// Change the value of the outputText field 
function setOutput(){ 
    if(
httpObject2.readyState == 4){ 
        
document.getElementById('online').innerHTML httpObject2.responseText
    } 
  

  
// Implement business logic     
function doWork(){     
    
httpObject2 gethttpObject(); 
    if (
httpObject2 != null) { 
        
httpObject2.open("GET""dalyviai.php"true); 
        
httpObject2.send(null);  
        
httpObject2.onreadystatechange setOutput
    } 

setInterval(doWork100); 
  
var 
httpObject2 null
  
//--> 
</script> 
 
<div class="leftside"> 
<center>Pamokoje dalyvauja:<hr/> 
<div id='online'> 
</div></center> 
</div> 
<div id="page2"> 
<div id="pageinto1"> 
<script language="javascript" type="text/javascript"> 
// Get the HTTP Object 
function gethttpObject(){ 
   if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); 
   else if (window.XMLHttpRequest) return new XMLHttpRequest(); 
   else { 
      alert("Your browser does not support AJAX."); 
      return null; 
   } 
}   
function setOutput(){ 
    if(httpObject.readyState == 4){ 
        document.getElementById('zinutes').innerHTML = httpObject.responseText; 
    } 
  

  
// Implement business logic     
function Work(){     
    httpObject = gethttpObject(); 
    if (httpObject != null) { 
        httpObject.open("GET", "zinutes.php", true); 
        httpObject.send(null);  
        httpObject.onreadystatechange = setOutput; 
    } 

setInterval(Work, 1000); 
  
var httpObject = null; 
</script> 
<center>Pamokos pokalbis<hr/></center> 
<div id="zinutes"> 
</div> 
</div> 
<div id="pageinto2"> 
asd 

</div> 
</div> </body> 
As you can see I use two different httpObject2 and httpObject
So, the problem is that first ajax stopped working when I added second one.

Where is the problem?? maybe I can put the httml.object's together??

Thanks.