• 0
Sign in to follow this  
serginhosant

Ajax Http.send

Question

Pessoal

Eu criei uma função para passar dois parâmetros.... através do http.send

só eu só estou conseguindo passar um.... vejam:

function editar(pagina, edt1, edt2) {

  http = getHTTPObject();

  str1 = "id1="+edt1;

  str2 = "id2="+edt2;

  http.open("POST",theURL+pagina+".php",true);

  http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//;charset='utf-8' 

  http.send(str1);

  http.onreadystatechange = function() {

  if (http.readyState == 4) {

    document.getElementById('responseContainer').innerHTML = http.responseText;

    http = null;

  }

  }

}

como faço para passar o str2 ???

obrigado

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

assim dá

function editar(pagina, edt1, edt2) {

http = getHTTPObject();

str = "id1="+edt1;

str += "&id2="+edt2;

http.open("POST",theURL+pagina+".php",true);   

        http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

http.send(str);

http.onreadystatechange = function() {

  if (http.readyState == 4) {

    document.getElementById('responseContainer').innerHTML = http.responseText;

    document.getElementById(edt1).style.display = "none";

    http = null;

}

    }

}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this