Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question (Page Dependent Linking) 1

Status
Not open for further replies.

ZekeO238

Programmer
Oct 1, 2002
32
0
0
US
Ok, Ill try not to confuse anyone. I have a webpage that has so far, two different style sheets. I am creating multipile CSS's just because its fun. Now, the question.

Right now I have a list of style selectors one every page. When you click on one it sends you to the index file of that style (each style is in its own folder, easier for me). What I was wondering is if I could use javascript to get the name of the file that is currently open then insert that into the file rather than always having the index file.

ex. <a href=&quot;/css/&quot;+filename+&quot;.html&quot;>Link</a>

I know that is totaly out of syntax but you get the idea, dont you? I hope so.
 

i don't quite understand your question (i almost do though), but here is an idea of how you can alter the destination of a link from the page as in your example...

***
<script>filename='css1'</script>

<a href=javascript:location.href='=&quot;/css/'+filename+'.html';>go there</a href>
***

hope that helps...if not, repost...

- spewn
 
Thanks spewn, works great! I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top