I have the following code:
<script type="text/javascript" language="javascript">
<!--
function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;
try{
xmlhttp=new XMLHttpRequest();
}
catch(e) {
try{
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e1){
xmlhttp=false;
}
}
}
return xmlhttp;
}
function wait1()
{
document.getElementById('comment').innerHTML="Please wait...";
}
function getComment(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('comment').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", "comment_form.php", true);
req.send(null);
}
}
//-->
</script>
<div id="comment">
<form action="javascript:get(document.getElementById('comment'));wait1()" method="post" enctype="multipart/form-data" >
<input type="submit" name="Submit" value="Post Your Comment" />
</form>
</div>
I am sure I used the same in past running smoothly, but now it doesn't seem to be working. I think something is messed up there, but not able to figure out.
I would be thankful if I get the solution.