Cannot load trending topics using AJAX?


#1

Hi,

I’m trying to have a little box on my website which shows a list of currently trending topics on twitter. This is what I’m currently doing:

             var top = 'http://api.twitter.com/1/trends/1.json';

		$.getJSON(top,function(hot){
			$.each(hot.trends,function(a,tag){
					$("#hot").append('<p>'+tag.name+' </p>');
			});
		});

However, I get the following errors:

Failed to load resource: the server responded with a status of 403 (Forbidden)

XMLHttpRequest cannot load http://api.twitter.com/1/trends/1.json. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

How should I solve this? Thanks


#2

Have you solved it?


#3