title: simultaneously calling 2 functions via ajax with "onclick"
body: <p>I have a problem using AJAX. I'm new to this so the answer could be simple!</p>
  
  <p>So, i have this piece of code.</p>
  
  <pre><code>echo '&lt;input type="button" onclick="opinion(1,\''.$v.'\'); op_status(1,\''.$v.'\');"/&gt;';
  </code></pre>
  
  <p>which is written in php.</p>
  
  <p>The 2 functions that are called via the onclick event, toggle AJAX in 2 different html divs. What i get is the outcome of the second function on both divs.</p>
  
  <p>Any ideas why this could be happening?</p>
  
  <p>Thanks!!</p>
  
  <p>sorry for the inconvenience but this is my first post. so this is one of the 2 (identical, just with different variables) js scripts.</p>
  
  <pre><code>function op_status(op,pid)
  {
  if (op=="")
    {
    document.getElementById("opstatus"+pid).innerHTML="";
    return;
    } 
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("opstatus"+pid).innerHTML=xmlhttp.responseText;
      }
    }
  xmlhttp.open("GET","post_op_stat_disp.php?ajxpid="+pid,true);
  xmlhttp.send();
  }
  </code></pre>
  
  <p>the file that is called makes some checks and outputs a text depending on that checks at a certain html div. the other js script does exactly the same, making some other tests and outputting some other text on another html div. :) however the outputs are the same text echoed in both the divs</p>