// sidtest.js // External Javascript for sidtest.html // RJM Programming // September, 2015 function xalert() { var wassectitle=document.getElementById('myhtitle'); var sectitle=document.getElementById('mybtitle'); var wasst=wassectitle.innerHTML; if (sectitle != null) { if (sectitle.innerHTML) { if (sectitle.title != "") { document.title=sectitle.innerHTML; } else if (sectitle.title) { if (sectitle.title != "") { document.title=sectitle.title; // rewrite title } } } else if (sectitle.title) { if (sectitle.title != "") { document.title=sectitle.title; // rewrite title } } } var huh=document.getElementById('mybscr'); alert('Just before we printout the source code 1 of 4 ... HTML element mybscr ' + ' of type ' + huh.getAttribute('data-type') + ' has id ' + huh.id + ' and title ' + huh.title); huh=document.getElementById('myhscr'); alert('Just before we printout the source code 2 of 4 ... HTML element myhscr ' + ' of type ' + huh.getAttribute('data-type') + ' has id ' + huh.id + ' and title ' + huh.title); huh=document.getElementById('myhescr'); alert('Just before we printout the source code 3 of 4 ... HTML element myhescr ' + ' of type ' + huh.getAttribute('data-type') + ' has id ' + huh.id + ' and title ' + huh.title + ' and src ' + huh.src); alert('Just before we printout the source code 4 of 4 ... which means you will' + ' be seeing the source code of ' + huh.src.replace('.js', '.html')); var printout="" + document.head.innerHTML.replace(document.title, wasst) + "" + document.body.innerHTML + ""; document.write("

" + printout.replace(//g, ">
") + "

"); }