Hello I am trying to implement dynamic Javascript breadcrumbs entirely client side.
I have been restricted from using server side languages for various reasons.
I have made some progress using these two threads:
1) jQuery generate breadcrumbs from url?
2) Approaches to build breadcrumbs
However I am still unable to successfully apply this code I am not used to working with Javascript and as such my experience is a limitation so please consider that in solutions.
Cheers.
This is what I have tried:
$(document).on("pageshow", "#breadcrumb", function breadCrumb(){
var here = location.href.split('/').slice(3);
var parts = [{ "text": 'Home', "link": '/' }];
for( var i = 0; i < here.length; i++ )
{
var part = here[i];
var text = part.toUpperCase();
var link = '/' + here.slice( 0, i + 1 ).join('/');
parts.push({ "text": text, "link": link });
}
});
I do not know how to convert back to HTML and put onto webpage.
This is what I am asking for help with.