|
var xmlHttp = createXmlHttpRequestObject();
// retrieves the XMLHttpRequest object
function createXmlHttpRequestObject()
{
var xmlHttp;
if(window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
xmlHttp = false;
}
}
// if running Mozilla or other browsers
else
{
try
{
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
xmlHttp = false;
}
}
if (!xmlHttp)
alert("Error creating the XMLHttpRequest object.");
else
return xmlHttp;
}
// make asynchronous HTTP request using the XMLHttpRequest object
function process(Mp3id)
{
//ObjDiv = document.getElementById("divMessage");
//ObjDiv.innerHTML ="Loading.....";
xmlHttp.open("GET","uploadMp3A.php?Show=true&mp3id="+Mp3id, true);
xmlHttp.onreadystatechange = handleServerResponse;
xmlHttp.send(null);
}
function handleServerResponse()
{
if (xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
Response = xmlHttp.responseText;
if(Response != "")
{
Arr = Response.split("&");
fo.addVariable("File",Arr[0]);
fo.addVariable("Title",Arr[1]);
fo.write("playerDivHeader");
}
}
else
{
alert("There was a problem accessing the server: " + xmlHttp.statusText);
}
}
}
|
|