When attempting to establish a connection and retrieve data from a PHP file using an AJAX request, it's important to note that the AJAX JS is located on a different website. Here is the script being used:
var quer;
try
{
quer = new XMLHttpRequest(); // This line gets called when running in Safari.
}
catch (e)
{
try
{
quer = new ActiveXObject("Msxml2.XMLHttp");
}
catch (e)
{
try
{
quer = new ActiveXObject("Microsoft.XMLHttp");
}
catch (e)
{
return false;
}
}
}
quer.onreadystatechange = function(){
if (quer.readyState == 4) // Data retrieval successful.
{
var resp = quer.responseText;
alert(resp);
}
}
quer.open("POST", "(URL hidden for security reasons)", true);
quer.send(null);
The 'resp' variable always remains empty. Can someone provide assistance with this issue?