Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Test case for SUMO issue 975037
<!DOCTYPE html>
<head><title>document.write and the back button</title></head>
<p>FAILED (not ran)</p>
<iframe src="./"></iframe>
// there is something odd with document.write() and IFRAME
// one immediately, inline
writeIframe('1st time - inline');
// one from onload handler
window.onload = function(){
writeIframe('2nd time(?) - onload');
// and one after onload
writeIframe('3rd time - timeout');
document.getElementsByTagName('p')[0].textContent += ' history.length: '+history.length
function writeIframe(str){
var ifr = document.getElementsByTagName('iframe')[0];;
document.getElementsByTagName('p')[0].textContent = 'How many times do you need to click the back button here?';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment