I recently encountered an issue with an ajax call that updates my database. While the call successfully goes out and updates the database, I do not receive any response back from the server. I have confirmed this using firebug, noticing that there is a post tab but no response tab as usual.
Below, you will find the code snippet that I have been working on. Any insights or assistance would be greatly appreciated.
function addCourse()
{
var memid = document.forms["addCoursesForm"]["Member"].value;
var CourseName = document.forms["addCoursesForm"]["CourseNames"].value;
var CourseDate = document.forms["addCoursesForm"]["Cdate"].value;
var CourseExpiry = document.forms["addCoursesForm"]["Edate"].value;
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyStat==4 && xmlhttp.status==200)
{
document.getElementById("ConfirmCourse").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST", "addCourseDB.php");
xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlhttp.send("memid="+ memid+ "&CourseName="+ CourseName+ "&CourseDate=" + CourseDate+"&CourseExpiry="+ CourseExpiry);