(function() { var jQuery; if (window.jQuery === undefined /*|| window.jQuery.fn.jquery !== '1.12.4'*/) { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"); if (script_tag.readyState) { script_tag.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { scriptLoadHandler(); } }; } else { script_tag.onload = scriptLoadHandler; } (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); } else { jQuery = window.jQuery; wowMain(); } function scriptLoadHandler() { jQuery = window.jQuery.noConflict(true); wowMain(); } function wowMain() { jQuery(document).ready(function($) { $('head').append( $('').attr('href', '//portal.wellsonwheels.co.uk/widget/embed-wow-widget.css') ); $(".wow-widget").each(function(i,obj){ var cmp = $(this).attr('data-cmp'); var type = $(this).attr('data-type'); var $this = $(this); $.getJSON('https://portal.wellsonwheels.co.uk/widget-embeddable/?id='+cmp+'&type='+type, function(data) { $this.html(data.html); }); }); }); } })();