i was trying to make two separate ajax request on one page
www.phoenix.exofire.net/events.php
i have two js written for it. when only one of the js are inserted it works fine , however when i insert both th js into my code one of the request doesnt take place.
Note: on clicking on the "pancratium " the second request should take place. however a request is sent to the server but a response is not received
www.phoenix.exofire.net/events.php
i have two js written for it. when only one of the js are inserted it works fine , however when i insert both th js into my code one of the request doesnt take place.
Code:
//login.js
var xmlHttp;
var status;
status=check_status();
function check_status()
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="check_status.php";
var param="";
//url=url+"&sid="+Math.random();
//alert("THIS IS THE REQ URL :\n"+url);
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open('POST',url,true);
//xmlhttp.setRequestHeader("POST /"+url+"HTTP/1.1");
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-Length" , param.length);
xmlHttp.setRequestHeader("connection", "close");
//xmlHttp.setRequestHeader("\r\n\r\n");
xmlHttp.send(param);
}
function stateChanged1()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
// document.getElementById("showstatus").innerHTML=xmlHttp.responseText ;
status=xmlHttp.responseText;
//alert(status);
select_content(status);
}
Code:
<script type="text/javascript">
var xmlHttp1;
function load_event (event_name)
{
xmlHttp1=GetXmlHttpObject();
if (xmlHttp1==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="event_details.php";
//var username=document.getElementById("login").username.value;
//var pass=document.getElementById("login").pass.value;
//var param="username="+username+"&pass="+pass;
var param="eventname="+event_name;
//url=url+"&sid="+Math.random();
alert("THIS IS THE REQ url : \n "+url);
xmlHttp1.onreadystatechange=stateChanged1;
xmlHttp1.open('POST',url,true);
//xmlhttp1.setRequestHeader("POST /"+url+"HTTP/1.1");
xmlHttp1.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp1.setRequestHeader("Content-Length" , param.length);
xmlHttp1.setRequestHeader("connection", "close");
//xmlHttp1.setRequestHeader("\r\n\r\n");
xmlHttp1.send(param);
}
function stateChanged1()
{
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
document.getElementById("events").innerHTML=xmlHttp1.responseText;
alert("THIS IS THE response : \n "+xmlHttp1.responseText);
}
function GetXmlHttpObject()
{
var XmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
XmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
XmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
XmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return XmlHttp;
}
</script>
Note: on clicking on the "pancratium " the second request should take place. however a request is sent to the server but a response is not received