Jason Gaved
Jason Gaved

Reputation: 11

AJAX and JavaScript

Im having an issue with the request below, for some reason I can seem to get the XML to display?

I've checked the URL and it displays fine, so im wondering whats going on?! Could anyone give me a hand? There should be something in the ResponseText not "NULL".

var url = "https://services.lexel.co.uk/paf/";

loadXMLDoc(url)

function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
alert(xmlhttp.responseText);
}

Upvotes: 0

Views: 99

Answers (2)

oneiros
oneiros

Reputation: 3578

Here is some literature on cross-domain ajax: http://www.xul.fr/ajax/xdomainrequest.php Cross domain request (XDR) http://msdn.microsoft.com/en-us/library/dd573303(v=vs.85).aspx

Upvotes: 0

SLaks
SLaks

Reputation: 888107

You cannot use AJAX to send a request to a different domain.

Upvotes: 3

Related Questions