I am trying to make a javascript rss parser. But I am having a problem even connecting to an url and getting the document back.
function myFunction(){
var xmlDoc;
var url="http://www.24ur.com/";
var conn = new XMLHttpRequest();
conn.onreadystatechange = function() {
if (conn.readyState == 4) {
console.log(conn.status);
}
};
conn.open("GET", url, true);
conn.send();
}
The conn.status in the console.log is 0. I get in the if clause but conn.status returns 0, responseText returns null.Shouldnt this be working??