(function() { // Localize variables to this anonymous function var jQuery; /******** Load jQuery if not present *********/ if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.6.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.6.4/jquery.min.js"); var script_is_loaded = false; script_tag.onreadystatechange = script_tag.onload = function() { if ((script_tag.readyState && script_tag.readyState!="complete" && script_tag.readyState!="loaded") || script_is_loaded) return; script_is_loaded = true; // flag to prevent any double execution (IE9 or Opera) 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($) { // Hide container jQuery('#ww-8923123-bakespace-recipes-container').hide(); // Load CSS file var css_link = $("", { rel: "stylesheet", type: "text/css", href: "https://www.bakespace.com/widgets/style.css" }); css_link.appendTo('head'); // Generate widget HTML createHTML(); // Show widget container jQuery('#ww-8923123-bakespace-recipes-container').show(); // Add GA click jQuery("#ww-8923123-bakespace-recipes-top-section-button-img").click(function(){ jQuery("#ww-8923123-bakespace-recipes-gaimg").attr("src","http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=286155420&utmhn=www.bakespace.com&utmcs=UTF-8&utmhid=746636727&utmp=%2Frecipe-widget%2Flaunch%2F2264%2Fwww.bakespace.com&utmac=UA-5278656-3&utmcc=__utma%3D1.4797074300145214523.1904697717.1703576251.1703576251.15%3B%2B__utmz%3D1.1703576251.1.1.utmcsr%3Drecipe-widget1%7Cutmccn%3Dwidget%7Cutmcmd%3Drecipe-widget1%3B"); }); // Add GA click jQuery("#ww-8923123-bakespace-recipes-footer-img").click(function(){ jQuery("#ww-8923123-bakespace-recipes-gaimg").attr("src","http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=294556951&utmhn=www.bakespace.com&utmcs=UTF-8&utmhid=280715728&utmp=%2Frecipe-widget%2Flaunch%2Flogo%2Fwww.bakespace.com&utmac=UA-5278656-3&utmcc=__utma%3D1.4173136900145214523.1466721851.1703576251.1703576251.15%3B%2B__utmz%3D1.1703576251.1.1.utmcsr%3Drecipe-widget1%7Cutmccn%3Dwidget%7Cutmcmd%3Drecipe-widget1%3B"); }); }); } // Create final widget HTML function createHTML (){ // Change the div to the new HTML jQuery("#ww-8923123-bakespace-recipes-container").html('
Check out my cookbook!
Cookbook Cover
The Official "Burnt" Movie Cookbook
View My Cookbook
7 great recipes including:
Burnt Movie Recipe: Quail, Carrot, Summer Savory
---
Burnt Movie Recipe: Rabbit, Beetroot, Watercress
---
Burnt Movie Recipe: Mascarpone, Blood Orange, Streusel
analytics image
'); } })(); // We call our anonymous function immediately