jsfiddle-import

by Andrea Ercolino

JavaScript

$(function(){
    
    $.proxyGet('http://jsfiddle.net/aercolino/jLDz9/show/', function (data) {$.globalEval(data);}, {
        filter: function(data) {
            var start   = '/*[[[[[*/'.replace(/\W/g, '\\$&');
            var end     = '/*]]]]]*/'.replace(/\W/g, '\\$&');
            var sections = [];
            data.replace(RegExp(start + '([\\s\\S]*?)' + end, 'g'), function(all, section) {
                sections.push(section);
            });
            return sections.join("\n;\n");
        }
    });
    
});

$.proxyGet=function(a,b,c){if(null!==a&&!/^(https?:|\/\/)/.test(a))throw new SyntaxError("Expected a URL.");a&&0===a.indexOf("//")&&(a=window.location.protocol+a);var d={url:"http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent('select * from html where url="--URL--" and compat="html5" and xpath="*"')+"&format=xml",cleanup:function(a){return(a=a.results&&a.results[0])?a=a.replace(/
/gi,"\r").replace(/
/gi,"\n"):null},filter:null};c=$.extend(d,c||{});var e=c.url.replace("--URL--",encodeURIComponent(a))+"&callback=?";$.getJSON(e,function(a){$.isFunction(b)&&($.isFunction(c.cleanup)&&(a=c.cleanup(a),$.isFunction(c.filter)&&(a=c.filter(a))),b(a))})};