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 Link to comment https://forums.phpfreaks.com/topic/55963-simplest-ajax-post-method/ 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 Link to comment https://forums.phpfreaks.com/topic/55963-simplest-ajax-post-method/#findComment-277992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.