ajax strange error with sending multiple parameter

Posted by kawtousse on Stack Overflow See other posts from Stack Overflow or by kawtousse
Published on 2010-05-27T08:08:41Z Indexed on 2010/05/27 8:11 UTC
Read the original article Hit count: 287

Filed under:

hi everyone, please check with me where is the error in this ajax code to send 2 parameters:

var xhr = getXhr();
// On défini ce qu'on va faire quand on aura la réponse
xhr.onreadystatechange = function(){
    // On ne fait quelque chose que si on a tout reçu et que le serveur est ok
    if(xhr.readyState == 4 && xhr.status == 200)
        {
        selects = xhr.responseText;
        // On se sert de innerHTML pour rajouter les options a la liste
        //document.getElementById('prjsel').innerHTML = selects;
        }
        };
        xhr.open("POST","ServletEdition",true);
          xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
          id=document.getElementById(idIdden).value;
          fu=document.getElementById("formUpdate").value;
          //alert(fu);
          var i=1;
          xhr.send("id=" +id+", fu="+i);

i cant got the value of fu i don't know why. thanks

© Stack Overflow or respective owner

Related posts about AJAX