我的代码一起使用Pug和jQuery有什么问题?

时间:2017-09-11 19:05:28

标签: javascript jquery pug

有人可以告诉我这里要改变什么吗?我正在尝试使用jQueryPug生成导航栏。类似的代码在HTML中实现时有效,但我的其余代码是用Pug编写的,我似乎无法进行必要的调整。谢谢!

帕格

doctype html
html
  head
  body
    .header
    .main-content
      a(href="#testtag" class="test2") The button bar should appear here

的JavaScript

jQuery(function($){
   place_buttons;
})(jQuery);

function place_buttons() {
  $('#a.test').on('click', function() {
    var navBar =
       '<a href="#dataList" class="fp"> &laquo; </a>' +
       '<a href="#dataList" class="pp"> Previous page </a>' +
       '<a href="#dataList" class="np"> Next Page </a>' +
       '<a href="#dataList" class="lp"> &raquo; </a>';

    $('#a.test').html(navBar);
  })
}  

输出

  

按钮栏应显示在此处

0 个答案:

没有答案