HighDots Forums  

breadcrumb help needed

Javascript JavaScript language (comp.lang.javascript)


Discuss breadcrumb help needed in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jaap V
 
Posts: n/a

Default breadcrumb help needed - 09-24-2003 , 11:22 AM






Hi,

I'm a total newbie at java, and I need some help adapting this little
breadcrumb script. I want it to NOT to show the domainname (it has to start
with the first subfolder) Is that possible? Can some adapt it for me if
possible, please?

TIA
Jaap
-------------
<script language="javascript">
function buildDepth(iterations)
{
var iterations=iterations-3;
var depthStr="";
for (i=0;i<iterations;i++)
{
depthStr=depthStr + "../";
}
return depthStr;
}
function buildBreadCrumbTrail()
{
var constituentFolders = new Array();
var currentURL = document.location.toString();
constituentFolders=currentURL.split("/");
var outputStr="";
for (count=2;count<(constituentFolders.length-1);count++)
{
outputStr=outputStr + " > <a href='" +
buildDepth((constituentFolders.length-count)+1) + "index.htm'>" +
constituentFolders[count] + "</a>";
}
document.write(outputStr);
}
</script>
--------------------



Reply With Quote
  #2  
Old   
Greg Griffiths
 
Posts: n/a

Default Re: breadcrumb help needed - 09-26-2003 , 07:41 PM






why not ask the original author
(http://www.greggriffiths.org/webdev/...t/breadcrumbs/) ?

Jaap V wrote:

Quote:
Hi,

I'm a total newbie at java, and I need some help adapting this little
breadcrumb script. I want it to NOT to show the domainname (it has to start
with the first subfolder) Is that possible? Can some adapt it for me if
possible, please?

TIA
Jaap
-------------
script language="javascript"
function buildDepth(iterations)
{
var iterations=iterations-3;
var depthStr="";
for (i=0;i<iterations;i++)
{
depthStr=depthStr + "../";
}
return depthStr;
}
function buildBreadCrumbTrail()
{
var constituentFolders = new Array();
var currentURL = document.location.toString();
constituentFolders=currentURL.split("/");
var outputStr="";
for (count=2;count<(constituentFolders.length-1);count++)
{
outputStr=outputStr + " > <a href='" +
buildDepth((constituentFolders.length-count)+1) + "index.htm'>" +
constituentFolders[count] + "</a>";
}
document.write(outputStr);
}
/script
--------------------


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.