add root url to href in jQuery
how can i add the root url to the href?
jQuery('#breadcrumb li').prepend('<li><a href="root url here">Home</a开发者_运维知识库> > </li>');
jQuery('#breadcrumb li').prepend('<li><a href="/">Home</a> > </li>');
A slash will always point to the web root.
var rooturl = http://example.com/;
jQuery('#breadcrumb li').prepend('<li><a href="' + rooturl + '">Home</a> > </li>');
精彩评论