开发者

add root url to href in jQuery

开发者 https://www.devze.com 2023-03-06 20:03 出处:网络
how can i add the root url to the href? jQuery(\'#breadcrumb li\').prepend(\'<li><a href=\"root url here\">Home</a开发者_运维知识库> > </li>\');

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>');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号