Request.YQLajax = new Class({ // gets basic info such as country and latitude data Extends: Request.JSONP, options: { log: !true, url: 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22{location}%22&format=xml' }, initialize: function(location, options) { this.parent(options); if (!location) return; this.options.url = this.options.url.substitute({location: encodeURIComponent(location)}); } }); // example use to fetch BBC's page new Request.YQLajax("http://www.bbc.co.uk/", { onSuccess: function(data) { document.id('result').set('html', data.results); } }).send();
<div id="result"></div>