<a href="file://$MYDIR/somefile.txt">one file</a>
and then somehow
firefox should resolve variable $MYDIR.
The idea is to use the same address for Linux and Windows, where $MYDIR means different paths.
Any help, please?
jose
How to pass variables in a URL?
5 posts • Page 1 of 1
April 6th, 2006, 9:11 am
I don't know if this is possible, but I'd like to write a URL as
<a href="file://$MYDIR/somefile.txt">one file</a> and then somehow firefox should resolve variable $MYDIR.
The idea is to use the same address for Linux and Windows, where $MYDIR means different paths. Any help, please? jose
April 6th, 2006, 9:18 am
Yes, you can do it with Javascript.
April 6th, 2006, 1:08 pm
I have no clue hot to use Javascript. Is there some code snippet I can look at?
jose
April 6th, 2006, 3:11 pm
I don't think you can get an environment variable with regular old javascript, but there is a mozilla component you can use:
April 6th, 2006, 4:06 pm
Now if I understand correctly, you want to select a separate document, dependant on the users OS. The thing you want to look at is the navigator.platform
for instance, your unix style page would have something like:
and slightly different, in your Windows style document you could include.
This would ensure that, in the event the user ends up at the wrong page, their browser will automatically switch over to the appropriate. You could also modify this slightly to "calculate" the name of the new page based on the current location. for example, if your Window document page names were identical to the unix version (but with the addition of a preceding W). In your unix pages you could use the expression "W"+location.href to find the windows page. In the meantime, in your windows pages you could use the expression location.href.substring(1) to get to the unix version. this would save you having to edit page name within the document on every page.
5 posts • Page 1 of 1
Who is onlineUsers browsing this forum: DanRaisch and 16 guests |
|