View Full Version : Directory Navigation
I am looking for the script you all are using
that shows what directory youare in and shows the path all the way back to start.
Zdnet uses that script too.
I have seen it on a archive site but can't remeber where can you help?
Yup sure, I use it on A1 JavaScripts although I havent posted it there for download there as yet. Here it is below.
==========================================
<script LANGUAGE="JavaScript">
<!-- Begin
//author: Jake Fairhead
var path = "";
var href = window.location.href;
var start = href.substring(0, href.indexOf('//') + 2);
var pos = href.indexOf('//');
href = href.substring(pos + 2, href.length);
pos = href.indexOf('/');
path = start + "";
document.write(start);
while (pos != -1) {
var name = href.substring(0, pos);
path += name + "/";
document.write("<a href=\"" + path + "\">" + name + "</a>");
document.write("<");
href = href.substring(pos + 1, href.length);
pos = href.indexOf('/');
}
// remove anchors
if (href.indexOf('#') != -1) {
href = href.substring(0, href.indexOf('#'));
}
// remove query string
if (href.indexOf('?') != -1) {
href = href.substring(0, href.indexOf('?'));
}
document.write("<a href=\"" + path + href + "\">" + href + "</a>");
// End -->
</script>
=============================================
Good Luck.
------------------
Ian
Web Development - Big Resources Inc
ian@123webmaster.com
ICQ: 25828668
BIG Resources.com (http://www.bigresources.com)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.