PolitiFactWidgetUpdate = new function() { var BASEURLU = 'http://www.politifact.com/media/js/'; var STYLESHEETU = 'http://static.politifact.com/js/widget/politifactwidget2.css'; var CONTENTURLU = 'http://www.politifact.com/truth-o-meter/widget/updates/5/'; var ROOTU = 'politifactupdate'; function requestStylesheetu(stylesheeturlu) { stylesheet_u = document.createElement("link"); stylesheet_u.rel = "stylesheet"; stylesheet_u.type = "text/css"; stylesheet_u.href = stylesheeturlu; stylesheet_u.media = "all"; document.lastChild.firstChild.appendChild(stylesheet_u); } function requestContentu( local ) { var scriptu = document.createElement('script'); // How you'd pass the current URL into the request // script.src = CONTENTURLU + '&url=' + escape(local || location.href); scriptu.src = CONTENTURLU; // IE7 doesn't like this: document.body.appendChild(script); // Instead use: document.getElementsByTagName('head')[0].appendChild(scriptu); } this.serverResponseu = function( data ) { if (!data) return; var divu = document.getElementById('politifactupdate'); var txtu = ''; for (var m = 0; m < data.length; m++) { if (txtu.length > 0) { txtu += " "; } txtu += data[m]; } divu.innerHTML = "

Tracking Obama\'s promises:

"; // assign new HTML into #ROOTU divu.style.display = 'block'; // make element visible } requestStylesheetu(STYLESHEETU); document.write("
"); requestContentu(); }