• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

BreadCrumb  RSS feed

 
Ranch Hand
Posts: 1329
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want to create a BreadCrumb, for a web site.

I have found the next code in the web;



I have checked the code of the Ebay web site, in order to get the idea of how they connect dinamically their categories and menu, with the BreadCrumb in order to generate it dinamically.

I dont find the clue there...

Could someone let me know in which folder the code should be (maybe the root folder?), and in overall how to proceed in order to integrate my code in a bigger/ real app, please?

Regards, Isaac
 
Angus Ferguson
Ranch Hand
Posts: 1329
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found that jQuery helps with this:

http://www.ajaxblender.com/xbreadcrumbs.html
 
Angus Ferguson
Ranch Hand
Posts: 1329
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code I am using now the jQuery code is paying, I dont need it this time...

Using Netbeans, I have tested this code:

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
   <head>

       <meta charset="UTF-8">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">

       <script type="text/javascript" src="xbreadcrumbs/jquery-3.1.1.min.js"></script>
       <script>
           //function breadcrumb(){
           $('.items a').on('click', function () {
               var $this = $(this),
                       $bc = $('<div class="item"></div>');

               $this.parents('li').each(function (n, li) {
                   var $a = $(li).children('a').clone();
                   $bc.prepend(' / ', $a);
               });
               $('.breadcrumb').html($bc.prepend('<a href="#home">Home</a>'));
               return false;
           });
           //};
       </script>
       <link rel="shortcut icon" href="">
   </head>
   
   <body >
       <div class="breadcrumb">
           <div class="item"><a href="#home">Home / </a></div>
       </div>

       <div class="items">
           <ul>
               <li><a href="#test1">Test 1</a></li>
               <li><a href="#test2">Test 2</a>
                   <ul>
                       <li><a href="level1">Level 1</a></li>
                       <li><a href="level2">Level 2</a>
                           <ul>
                               <li><a href="level3">Level 3</a></li>
                               <li><a href="level4">Level 4</a></li>
                           </ul>
                       </li>
                   </ul>
               </li>
               <li><a href="#test1">Test 3</a></li>
           </ul>
       </div>
   </body>
</html>


I already fixed the errors from the Chrome console, but although when the links are click it updates the URL, it doesnt updates the breadcrumb itself. Always "home"  appears....

The same code in Fiddle works...should I maybe call the function another way... It looks that the problem is not with the code but with the way I am using it in local.

Any idea, please?
 
Angus Ferguson
Ranch Hand
Posts: 1329
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code I am using now the jQuery code is paying, I dont need it this time...

Using Netbeans, I have tested this code:



I already fixed the errors from the Chrome console, but although when the links are click it updates the URL, it doesnt updates the breadcrumb itself. Always "home"  appears....

The same code in Fiddle works...should I maybe call the function another way... It looks that the problem is not with the code but with the way I am using it in local.

Any idea, please?
 
Just the other day, I was thinking ... about this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!