Im trying to add a twitter trends section to my web site, im trying to do this using the json object that twitter provides from accessing this URL (http://api.twitter.com/1/trends.json) when i use the following code i see the below error. Does anyone know where im going wrong ?
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://api.twitter.com/1/trends.json",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status!=404) {
alert(xmlhttp.responseText);
}
}
}
xmlhttp.send(null);
Error :
XMLHttpRequest cannot load http://api.twitter.com/1/trends.json. Origin null is not allowed by Access-Control-Allow-Origin.
This was tested in chrome but worked in IE and idea's ?
