The code in my snippet is a function which is called when the page is done loading. Basically it is supposed to pop up a save as dialog, and then redirect the user back to their previous location. This works fine in IE6 and has been working for some time. The client recently upgraded their machines to IE8. Now it still works about 80% of the time but 20% of the time the redirect does not occur.
As you can see I was using history.go(-1), I tried changing it to .back() with the same result. There are are no errors and I am failry certain the code is executing. THe save as works fine but then 1/5 times it wont do the redirect after the save. Also the site has been added to trusted sites. The very strange part is that after it fails, if I click the "back" button manually, nothing happens and the button becomes grayed out. It is as if the history was wiped out.
One last thing, someone suggested the doctype might be an issue so I tried a couple different ones but the main one I have been using is:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
fullURL = parent.document.URL;
repID = fullURL.substring(fullURL.indexOf('?')+15, fullURL.indexOf('&'));
strsave = fullURL.substring(fullURL.indexOf('save')+4, fullURL.length);
if(strsave.length > 1 && strsave.length < 5)
bSuccess=document.execCommand('SaveAs', '1', repID + ".html");