/* FILE ARCHIVED ON 9:05:47 Oct 17, 2012 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 0:06:57 Oct 3, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ PolitiFactWidget = new function() { var BASE_URL = 'https://webarchive.library.unt.edu/web/20121017090547/http://www.politifact.com/media/js/'; var STYLESHEET = 'https://webarchive.library.unt.edu/web/20121017090547/http://static.politifact.com.s3.amazonaws.com/js/widget/politifactwidget.css'; var CONTENT_URL = 'https://webarchive.library.unt.edu/web/20121017090547/http://www.politifact.com/truth-o-meter/widget/latest/3/'; var ROOT = 'politifact'; function requestStylesheet(stylesheet_url) { stylesheet = document.createElement("link"); stylesheet.rel = "stylesheet"; stylesheet.type = "text/css"; stylesheet.href = stylesheet_url; stylesheet.media = "all"; document.lastChild.firstChild.appendChild(stylesheet); } function requestContent( local ) { var script = document.createElement('script'); // How you'd pass the current URL into the request // script.src = CONTENT_URL + '&url=' + escape(local || location.href); script.src = CONTENT_URL; // IE7 doesnOt like this: document.body.appendChild(script); // Instead use: document.getElementsByTagName('head')[0].appendChild(script); } this.serverResponse = function( data ) { if (!data) return; var div = document.getElementById(ROOT); var txt = ''; for (var i = 0; i < data.length; i++) { if (txt.length > 0) { txt += " "; } txt += data[i]; } div.innerHTML = "
The Truth-O-Meter Says:
" + txt + "
"; // assign new HTML into #ROOT div.style.display = 'block'; // make element visible } requestStylesheet(STYLESHEET); document.write("
"); requestContent(); }