function digizuiteLoadScript(url, callback) { // Adding the script tag to the head as suggested before var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; // Then bind the event to the callback function. // There are several events for cross browser compatibility. script.onreadystatechange = callback; script.onload = callback; // Fire the loading head.appendChild(script); } digizuiteLoadScript("https://samadmin.ada.org/dmm3bwsv3/embedplayer/scripts/require.js", function(){ require.config({ paths : { 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min', 'flowPlayer': 'https://samadmin.ada.org/dmm3bwsv3/embedplayer/flow/flowplayer.min' }, shim : { jquery : { exports : 'JQuery' }, flowPlayer : { exports : 'FlowPlayer', deps: ['jquery'] } } }); require(['jquery', 'flowPlayer'], function($, flowPlayer) { $("head").append(""); DigizuitePlayer = (function () { var init = function (domId, config) { var key = '$356706318878159'; if (typeof config != 'object'){ config = { 'key': key}; }else if (typeof config === 'object'){ config.key = key; } $("." + domId).flowplayer(config); }; return { init: init }; }()); var playerIdList = ["digiPlayer"]; for (var i=0; i