Simple Ajax Woes

Hi,

My first attempt at AJAX. Try to read an XML (RSS File) and populate a text-area.

Almost taken verbatium from this tutorial: http://www.kirupa.com/developer/php/ajax_intro.htm

The html file below is on my local machine and it retrieves an RSS feed when the user clicks a button. But the text area does not seem to get populated… :frowning:

From the examples, I have seen on the forum, the URL must also be on the same domain? Otherwise, I am lost.

Thanks!

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
<script language=“javascript” type=“text/javascript”>
var xmlHttp;
function createRequest() {
if(window.ActiveXObject){
xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);
}
else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
function ajax() {
createRequest();
var url = “http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml”;
xmlHttp.open(“GET”, url, true);
xmlHttp.onreadystatechange = StateChange;
xmlHttp.send(null);
}
function StateChange(){
if(xmlHttp.readyState == 4) {
alert(xmlHttp.responseXML);
var response = xmlHttp.responseText;
document.getElementById(“reply”).innerHTML = response;
}
}
</script>
</head>
<body>
<textarea rows=“20” cols=“40” name=“reply”></textarea>
<input type=“button” onClick=“ajax();” value=“Click here to AJAX it up”>
<te>
</body>
</html>