function appendScript(e, s, jq, wrapper) { console.log(wrapper) e.src = s; if (jq === true) { e.onload = function () { jQuery.noConflict(); appendScript(document.createElement('script'), 'https://meet.pfadi-sirius.ch/Resources/js/tether.min.js', false, wrapper); appendScript(document.createElement('script'), '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js', false, wrapper); fetch(); }; } wrapper.appendChild(e); } $ = jQuery; var container = document.createElement('div'); container.className = "container-fluid"; container.id = "meeting-container"; container.style = "display:none"; var meeting = document.getElementById("meeting"); meeting.appendChild(container); var fired_fetch = false; //appendScript(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js', true, container); jQuery('#meeting').append(''); function addLoader() { jQuery('#meeting').append('

Chästlizettel Smarties

'); get_json(); } jQuery('#meeting').append(''); function get_json() { if (fired_fetch === false) { fired_fetch = true; jQuery.ajax({ dataType: "json", url: "https://meet.pfadi-sirius.ch/?action=display2&json&group=Smarties", success: function (data) { if (data['status'] === "200") { setTimeout(function () { var meeting = data['results']['meeting']; var html = data['results']['html']; jQuery('#meeting-container').append(html); jQuery('.spinner').addClass("fade-out"); jQuery('.spinner').removeClass("spinner"); setTimeout(function () { jQuery('#loader').hide(); jQuery('#meeting-container').fadeIn(); }, 100); }, 500); } }, error: function (xhr, ajaxOptions, thrownError) { console.log(xhr, ajaxOptions, thrownError); setTimeout(function () { if (xhr.responseText !== undefined) { message = xhr.responseText } else { message = "Unbekannter Fehler" } jQuery('#loader p').html('

Fehler:
' + message + '

'); jQuery('.spinner').attr('style', 'animation: none; -webkit-animaition: none; border-radius: 30px; height: 5px').addClass('fail'); }, 1000); } }); } }