PDA

View Full Version : Breadcrumb Script Help



imensing
09-06-2007, 04:43 PM
Need help with below breadcrumb script
I do not want this script to show the main URL index.

right now it shows:
http://www.home.com/page1/page2/page3

What I want it to do is show:
home/page1/page2/page3

Thanks in advance



<SCRIPT LANGUAGE="JavaScript">
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+1)+"/\">"+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>