Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Directory header


< html >
< head >
</ head >
< body >
< script >
var path = "" ;
var href = document.location.href;
var s = href.split( "/" );
for ( var i = 2;i < (s.length - 1);i ++ ) {
path += "<A HREF=\"" + href.substring(0,href.indexOf(s[i]) + s[i].length) + "/\">" + s[i] + "</A> / " ;
}
i = s.length - 1;
path += "<A HREF=\"" + href.substring(0,href.indexOf(s[i]) + s[i].length) + "\">" + s[i] + "</A>" ;
var url = window.location.protocol + "//" + path;
document.writeln(url);
</ script >
</ BODY >
</ html >