function handleResponse(response) {
document.getElementById('bandgigs-widget-container').innerHTML = response;
}
(function() {
// Localize jQuery variable
var jQuery;
/******** Load jQuery if not present *********/
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') {
var script_tag = document.createElement('script');
script_tag.setAttribute("type","text/javascript");
script_tag.setAttribute("src",
"https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js");
if (script_tag.readyState) {
script_tag.onreadystatechange = function () { // For old versions of IE
if (this.readyState == 'complete' || this.readyState == 'loaded') {
scriptLoadHandler();
}
};
} else {
script_tag.onload = scriptLoadHandler;
}
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
} else {
// The jQuery version on the window is the one we want to use
jQuery = window.jQuery;
main();
}
/******** Called once jQuery has loaded ******/
function scriptLoadHandler() {
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local jQuery variable
jQuery = window.jQuery.noConflict(true);
// Call our main function
main();
}
/******** Our main function ********/
function main() {
jQuery(document).ready(function($) {
jQuery.support.cors = true;
var bandid = '87';
var theme = 'dark';
var width = '100pc';
var links = '1';
var fontsize = '1.3em';
var ssl = 'False';
var other = 'True';
/******* Load CSS *******/
var css_style = $("", {
rel: "stylesheet",
type: "text/css",
href: "https://bandbase.co.uk/Widgets/BandGigGuide/css/styles.css"
});
css_style.appendTo('head');
var css_theme = $("", {
rel: "stylesheet",
type: "text/css",
href: "https://bandbase.co.uk/Widgets/BandGigGuide/css/" + theme + ".css"
});
css_theme.appendTo('head');
/******* Load HTML *******/
$.ajax({
url: "https://bandbase.co.uk/Widgets/BandGigGuide/Widget.ashx?bandid=" + bandid + "&theme=" + theme + "&width=" + width + "&links=" + links + "&fontsize=" + fontsize + "&other=" + other + "&ssl=" + ssl,
dataType: "jsonp",
type: "GET",
cache: false,
crossDomain:true,
contentType: "application/json; charset=utf-8",
jsonpCallback: "handleResponse"
});
});
}
})(); // We call our anonymous function immediately