Panjabel Posted June 17, 2007 Share Posted June 17, 2007 Hello ppl, please post someone the simples ajax post method or post method with prototype i've searched 2 days over internet didn't find a concrete simple example, only bllshits (excuse my language). please help Quote Link to comment Share on other sites More sharing options...
immunity Posted June 19, 2007 Share Posted June 19, 2007 function postForm() { var url2 = "register2.php"; var params = "account=testisok&email=yeah"; http.open("POST", url2, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", params.length); http.setRequestHeader("Connection", "close"); http.send(params); http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) { alert(http.responseText); http.abort(); } } } function getHTTPObject() { var xmlhttp; if(window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); if (!xmlhttp){ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } } return xmlhttp; } var http = getHTTPObject(); // We create the HTTP Object Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.