Simple Ajax Woes


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

Almost taken verbatium from this tutorial:

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.


<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN””>
<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() {
xmlHttp = new ActiveXObject(“Microsoft.XMLHTTP”);
else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
function ajax() {
var url = “”;“GET”, url, true);
xmlHttp.onreadystatechange = StateChange;
function StateChange(){
if(xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
document.getElementById(“reply”).innerHTML = response;
<textarea rows=“20” cols=“40” name=“reply”></textarea>
<input type=“button” onClick=“ajax();” value=“Click here to AJAX it up”>