title: how to pass a javascript associative array in ajax to php file
body: <p>How can i pass data (associative array) to php file.</p>
  
  <pre><code> function ajax(url,data,callback)
          {
              var xmlhttp;
              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()
              {
                  xmlhttp.onreadystatechange = function() {
                      if ( xmlhttp.readyState === 4 ) {
                          callback( xmlhttp.responseText );
                      }
                  }
              }
              xmlhttp.open("POST",url,true);
              xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
              xmlhttp.send(data);
          }
  </code></pre>