3Wheels
02-21-2001, 10:46 AM
Hi all,
I have a copy of my web site archived on both my Windows and Linux machines. When I access either of these off-line versions (no web server involved), I usually use file-open and drill down to the main index.html.
However, I use BASE HREF to set the parent directory to "C:/" on Windows and "/home/bubba" on Linux. This requires several hand edits throughout the web pages. I'd like to use some technique to determine which platform I'm on and set BASE HREF accordingly. This way, the HTML can be the same on both platforms.
For example, I tried to use the JavaScript File object to open a file (C:/testfile). If it returned true, set BASE HREF to "C:", else set it to "/home/bubba". But I couldn't get it to work.
Can this be done with JavaScript, plain HTML, or even Java?
TIA, Matt
I have a copy of my web site archived on both my Windows and Linux machines. When I access either of these off-line versions (no web server involved), I usually use file-open and drill down to the main index.html.
However, I use BASE HREF to set the parent directory to "C:/" on Windows and "/home/bubba" on Linux. This requires several hand edits throughout the web pages. I'd like to use some technique to determine which platform I'm on and set BASE HREF accordingly. This way, the HTML can be the same on both platforms.
For example, I tried to use the JavaScript File object to open a file (C:/testfile). If it returned true, set BASE HREF to "C:", else set it to "/home/bubba". But I couldn't get it to work.
Can this be done with JavaScript, plain HTML, or even Java?
TIA, Matt