I have a WEB app that is made up of an HTML page that is a frame only and other HTML pages are loaded into this frame. One of these HTML pages (that is loaded into the frame) allows the user to download a text file. Under Netscape browsers, the user 'left-clicks' and the file is downloaded. Under I.E. browsers, instead of downloading the file, it is displayed in frame, replacing the HTML page that contained the link.
What I want to do (and have tried to do unsuccessfully) is trap the 'left-click' when the browser is I.E. and inform the user that to successfully download the file, they need to 'right-click' and select 'Save Target As' from the floating menu. I have actually created something like that, that works for I.E. 4.0 (always) and I.E. 3.02 when the HTML page is not running in a frame. I need a solution that works all of the time. I know about setting up defaults for file extentions and that will not work in this case. The file extentions will vary but they will always be text files.
I have included what I have done so far. As part of the answer, I would like a working example that consists of a frame HTML page that loads the download HTML page and correctly allows the Netscape 'left-click' to work and traps the I.E. 'left-clicks' for the 4.X and 3.X versions of the browsers.
*** example, start ***
function funcDownload( )
sBrowserName = navigator.appName;
nBrowserVersion = parseInt( navigator.appVersion);
if ( sBrowserName == "Microsoft Internet Explorer" )
alert( "\nRemember:\n\nTo download a file you need to 'right-click' and\nchoose 'Save Target As' not 'left-click'." );
if ( nBrowserVersion < 4 )
self.location = this.document.location;
window.event.returnValue = false;
*** example, end ***