javascript - jquery a href conflict with handlebars link -
i have a href when hover on shows correct link. using handlebars.
{{#each tabs}} <li><a href="/tabs/{{this.tabid}}" data-toggle="tab">{{this.tabname}}</a></li> {{/each}}
when click a
uncaught error: syntax error, unrecognized expression: /tabs/1
if removed jquery page works fine, need jquery rest of page.
any ideas?
edit:
<div id="content"> <div id="content-container"> <div class="tabbable"> <ul class="nav nav-tabs"> {{#each tabs}} <li><a href="/{{this.tabid}}" data-toggle="tab">{{this.tabname}}</a></li> {{/each}} </ul> <div class="tab-content"> {{#each tabs}} <div id="{{this.tabid}}" class="tab-pane"> <h4>{{this.tabname}}</h4> </div> {{/each}} </div><!-- /.tab-content --> <div> {{#each servers}} <h4>{{this.servername}}</h4> {{/each}} </div> </div><!-- /.tabbable --> </div> <!-- content-container -->
basically using "/" in href attribute. should id of content tab , jquery selector can not starts "/".
<ul class="nav nav-tabs" role="tablist"> {{!-- should use prefix id "tab"--}} {{#each this}} <li role="presentation"><a href="#tab{{this.tabid}}" data-toggle="tab">{{this.tabname}}</a></li> {{/each}} </ul> <div class="tab-content"> {{#each this}} <div role="tabpanel" class="tab-pane" id="tab{{this.tabid}}">{{this.tabname}}</div> {{/each}} </div>
Comments
Post a Comment