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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I write the current folder name to tha page? 1

Status
Not open for further replies.

mjpost

Technical User
Feb 4, 2002
9
AU
From a path like I want to extract just “thisfolder” & write it to the page, window title bar, or whatever.

Making it clickable would be nice too.

Any suggestions?
 
Hi
This will put the containing folder (is that what you wanted) in a variable called folder that you can do whatever you want with.
Code:
<script>
var loc = location.href;
var arrloc = loc.split(&quot;/&quot;);
folder = arrloc[arrloc.length-2];
alert(folder);
</script>
Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) &&(((parseIntx.toString()+y.toString())-x-y)%9)!=0)){alert(&quot;I'm a monkey's uncle&quot;);}
 
No probs. [wiggle] Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) &&(((parseIntx.toString()+y.toString())-x-y)%9)!=0)){alert(&quot;I'm a monkey's uncle&quot;);}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top