(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","http://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: "http://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=193950638&utmcs=UTF-8&utmhid=783958070&utmp=%2Frecipe-widget%2Flaunch%2F2989%2F&utmac=UA-5278656-3&utmcc=__utma%3D1.7945451100145214523.1302553053.1513137548.1513137548.15%3B%2B__utmz%3D1.1513137548.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=587125444&utmcs=UTF-8&utmhid=887651357&utmp=%2Frecipe-widget%2Flaunch%2Flogo%2F&utmac=UA-5278656-3&utmcc=__utma%3D1.4779327000145214523.1144806801.1513137548.1513137548.15%3B%2B__utmz%3D1.1513137548.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
MeatLess is More
View My Cookbook
76 great recipes including:
Roasted Vegetable Lasagna with Cashew “Ricotta”
---
Curry Stew with Tofu and Cabbage
---
Sweet Potato Crumble Casserole
analytics image
'); } })(); // We call our anonymous function immediately