function GetContent(url, method, place, params)
{
switch (method){
case "GET":
var kl = window.location.href.indexOf("?",0);
lastpage = window.location.href.substr(kl);
document.getElementById(place).innerHTML = "<center>Loading, please wait...<br /><img src='load.gif' /></center>";
thing = new DICKBUTT();
thing.open("GET", url, true);
glb_location = place;
thing.onreadystatechange = updatePage;
thing.send(null);
lastpage = GetDo();
break;
case "POST":
document.getElementById(place).innerHTML = "<center>Your request is being processed, please wait...<br /><img src='load.gif' /></center>";
thing = new DICKBUTT();
thing.onreadystatechange = updatePage;
thing.open("POST", url, true);
thing.setRequestHeader("Content-type", "applicationx-www-form-urlencoded");
thing.setRequestHeader("Content-length", params.length);
thing.setRequestHeader("Connection", "close");
glb_location = place;
thing.send(params);
break;
}
}
function SubmitShout(form)
{
alert("1");
var message = form.message.value;
var name = form.name.value;
var check = 0;
alert("2");
if (name.length < 3)
{
form.name.className = 'error';
check = 1;
return false;
}
alert("3");
if (message.length < 3)
{
form.message.className = 'error';
check = 1;
return false;
}
alert("4");
alert("5");
if (check === 0) {
var zeparams = "message="+message+"&name="+name;
GetContent("shoutbox.php", "POST", "shoutform", zeparams);
return false;
}
return false;
}
The POST request does not work... Anything look wrong? I have gone through it many times :S
Also, you may see a ton of alerts, well that is for debugging, and it goes to 5