If you don't like to include jQuery library for url change. We need following functions
function getByClassName( className , selector ) {
selector = selector || document;
if( selector.getElementsByClassName ) {
return selector.getElementsByClassName( className );
}
var els = [];
var childs = selector.getElementsByTagName( '*' );
for( var i = 0, j = childs.length; i < j; i++ ) {
if( childs[i].className.indexOf( className ) > -1 ) {
els.push( childs[i] );
}
}
return els;
};
function changeUrl( els , url , newUrl ){
for( var i = 0; i < els.length ; i++ ){
if ( els[i].href == url ) {
els[i].href = newUrl ;
}
}
}
and call the function
changeUrl (
getByClassName( 'category' , document.getElementById('breadcrumbs') ) ,
"http://asksomeone.co.za/category/products" ,
"http://myurl.com/803-2"
);
or If you are using jQuery library .. use this
(function( JQ ){
JQ('#breadcrumbs .category[href="'
+ 'http://asksomeone.co.za/category/products"]')
.attr('href',"http://myurl.com/803-2");
})( jQuery );