[Solved] two set interval function in single PHP file is not working


When loading execute both operations together.

updateChatAJAx(); 
updateChatAJAx1();

Then setInterval for both actions

   var flag=0;
    $(function(){

        setInterval(function () {

          if(flag==0)
           {
             updateChatAJAx(); 

           }
          else
           {
             updateChatAJAx1();

           }

        }, 2000);
    });

Change the flag to choose operation.

flag=0 -> updateChatAJAx(); 

and

flag=1 -> updateChatAJAx1(); 

solved two set interval function in single PHP file is not working