/* jQuery Plugin waz map script version 1.0, May 7th, 2018 */ (function () { var version = "1.0"; if (!window.jQuery) { var headTag = document.getElementsByTagName("head")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js'; headTag.appendChild(jqTag); } getWazeMap = function () { var token = getCookie('smart1_leads_token'); var latitude = getCookie('latitude'); var longitude = getCookie('longitude'); jQuery.ajax({ url: "https://app.smart1leads.com/api/wazemap/ky1S9yR43vniYjOf?latitude="+latitude+"&longitude="+longitude, type: "GET", headers: { 'Authorization':'Bearer '+token }, success: function (result) { jQuery("body").append(result); }, error: function (xhr, status, error) { console.log(error); } }); }; getCookie = function (cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } })();