Results 1 to 3 of 3

Thread: Breadcrumbs!

  1. #1
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default Breadcrumbs!

    This tool used to display the path to the current page. There are three types of breadcrumbs: path, attribute, and location.
    The script is as follow:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> 
    <head> 
    <title>BreadCrumb</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body> 
    <p align="left">
    
    <script type="text/javascript">
    <!-- Begin Hiding
    
    c_url = new String();
    n_bytes = new Object();
    var x = 0;
    var stop = 0;
    var output = '<a href="/">Main</a> &nbsp;>>&nbsp;';
    c_url = location.href;
    c_url = c_url.slice(8, c_url.length);
    leftOver = c_url.indexOf('/');
    c_url = c_url.slice( leftOver +1, c_url.length)
    while( !stop ) { 
    leftOver = c_url.indexOf('/');
    if (leftOver != -1) { n_bytes[x] = c_url.slice(0, leftOver); 
    c_url = c_url.slice( leftOver +1, c_url.length) } else { stop = 1; } x++; } 
    for ( var i in n_bytes ) { output += '<a href="';
    for ( y = 1; y < x - i; y++ ) { output += '../'; } 
    output += n_bytes[i] + '/">' + n_bytes[i] + '</a> &nbsp;>>&nbsp;'; } 
    document.write(output + document.title);
    
    // Done Hiding -->
    
    </script>
    
    </p>
    </body>
    </html>
    Last edited by ddadmin; 07-31-2008 at 06:57 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Nice, was there a problem with this script. Or are you just sharing.
    But anyways, pretty cool, I like it. Although I don't like the fact its in javascript. I'd much rather use PHP for a bread crumb. For example:
    http://www.dynamicdrive.com/forums/s...84&postcount=4
    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default My thanks

    Yeah, am just sharing about this breadcrumbs' stuff! Sorry bud but am not that good on handling php... Maybe you can share me more things about php. Thanks...

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •