It looks like you are using jQuery. The jsonp option for the data type provided by the jQuery ajax call is a more elegant solution for this, as a short example:
$.ajax({ url : 'http://api.yelp.com/business_review_search', dataType : 'jsonp', data : {term : 'restaurant', lat : xxx, long : xxx}, // callback is not necessary success : function(data) { // data is a normal response shown on yelp API page } });
source share