(function() { var jQuery; if (document.readyState === "complete") { load(); } else { window.onload = load; } function load () { if (window.jQuery === undefined) { var script_tag = document.createElement('script'); script_tag.setAttribute("type", "text/javascript"); script_tag.setAttribute("src", "https://code.jquery.com/jquery-3.4.1.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; main(); } } function scriptLoadHandler() { jQuery = window.jQuery.noConflict(true); main(); } function main() { jQuery(document).ready(function () { var divTag = document.getElementById("viewagents-widget"); var privateKey = divTag.getAttribute("data-key"); if (privateKey == null || privateKey === undefined || privateKey.trim().length === 0) return; jQuery.get("https://widget.viewagents.com/api/Widget", { privateKey: privateKey }, function (data) { jQuery("#viewagents-widget").html(data); }); }); } })();