TYSWidget16801 = new function() { var BASE_URL = "https:\/\/toyoursuccess.com"; var CONTENT_URL = BASE_URL + '/reviews/content:6801:1:'; var POPUP_URL = BASE_URL + '/reviews/popup:6801'; var ROOT = 'tys_widget1_6801'; function requestContent() { url = CONTENT_URL; var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } this.popup = function () { var newwindow = window.open(POPUP_URL,'tys_popup','height=720,width=1000,resizable,scrollbars=yes'); if (window.focus) {newwindow.focus()} return false; } this.serverResponse = function( data ) { if (!data) return; var div = document.getElementById(ROOT); div.innerHTML = data[0]; // assign new HTML into #ROOT div.style.display = 'block'; // make element visible } document.write(""); requestContent(); }