if(window.location.href.match(/\/subject\/\d+/)){ let edit_detail = window.location.href.match(/\/subject\/\d+/)[0]+'/edit_detail'; $("#headerSubject").find("[class='navTabs clearit']").append("<li><a href="+edit_detail+">Wiki</a></li>"); }