var species = {}; $('document').ready(function(){ $.get( "/species", function( species_r ) { species_r.data.map(function(item) { species[item._id] = item }); $( "#body" ).load( "/templates/home.html", function(){$("#load").fadeOut("slow"); get_info(); setInterval(() => { get_info()}, 300000); }); $("body").bgswitcher({ images: ["/images/bg0.jpg", "/images/bg1.jpg", "/images/bg2.jpg", "/images/bg3.jpg", "/images/bg4.jpg"], loop: true, duration: 1500 }); }); });