var $;
(function(){
// https://code.jquery.com is not reachable so all jquery is failing.
// For now as (hopefully) temp workaround, using other cdn:
//
// Put this in html tab: [script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"][/script]
// (when putting [/script] here with proper tag characters everything breaks so pasted with square brackets)
//
// The while loop is evil, but this makes code halt before code below until we have $ available.
// After 3 sec or n loops break out so we do not get stuck in an infinite loop.
//
var fallback = false, n=0;
setTimeout(function(){fallback = true;}, 3000);
while(!window.$) {
n++;
if(fallback || n > 10000){break;}
}
$ = window.$;
})();
var searchFiddles = {
getUsername: function() {
return $("#jsfiddle_username").val() || '';
},
getQuery: function() {
return $("#query").val() || '';
},
setError: function(html) {
$('#errorMessage').html(html);
},
setLoading: function(is_loading) {
$("#loader").toggleClass('hidden', !is_loading);
$('form, form input').attr('disabled', !!is_loading);
$('#results_table').css('opacity', is_loading ? '0.5' : '');
$('#query').focus();
},
updatePublicFiddlesLink: function() {
var username = this.getUsername();
$('#publicfiddleslink').attr('href', 'https://jsfiddle.net/user/' + username + '/').text(username + ' public fiddles');
},
launchSearch: function() {
this.updatePublicFiddlesLink();
this.setLoading(true);
this.setError('');
// TODO fetch multiple pages if we get 100 results
$.ajax({
url: "https://jsfiddle.net/api/user/" + this.getUsername() + "/demo/list.json",
data: {
limit: 100
// limit: 100, // default: 10, max appears to be 100
// start: 10, // 2nd page would be 100
// // default is sort:'date' order:'desc'. quirk: it seems if you only supply sort:'date' the default for order falls back to order:'asc'. odd.
// sort: 'date', // 'date', 'alphabetical', 'framwork'. default:...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.