(function () { function ensureJQuery(callback) { if (window.jQuery && jQuery.fn && jQuery.fn.jquery) { callback(); } else { setTimeout(function () { ensureJQuery(callback); }, 100); } } function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function loadStylesheet(href) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.href = href; document.head.appendChild(link); } function initWidget() { (function ($) { loadScript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js', function () { loadStylesheet('https://registeredbccontractor.ca/css/widget.css'); var root = document.getElementById('contractor-container'); if (root) { var div = document.createElement('div'); div.classList.add('contractor-widget'); div.innerHTML = `

What type of efficiency upgrade are you planning?

Where is the home located?

Filters

Filter by language:

`; root.appendChild(div); loadScript('https://registeredbccontractor.ca/js/widget.js', function () { console.log('Widget initialized!'); }); } }); })(jQuery); } ensureJQuery(initWidget); })();