jquery使被点击标签置于选中状态并发GET请求

  $(document).ready(function(){
    $("li.shop-list-menu-item").click(function(){
      $("li.shop-list-menu-item").removeClass('active');
      $(this).addClass('active');

      var nodeVal = $(this).children('span').text();
      if($.trim(nodeVal) == '卡牌')
      {
        url = "{{ path('tron_hearth_stone_product_hearth_stone_list', { categoryId:11 }) }}";
        $.get( url );
      }
      else if($.trim(nodeVal) == '冒险模式')
      {
        url = "{{ path('tron_hearth_stone_product_hearth_stone_list', { categoryId:12 }) }}";
        $.get( url );
      }
      else if($.trim(nodeVal) == '英雄')
      {
        url = "{{ path('tron_hearth_stone_product_hearth_stone_list', { categoryId:13 }) }}";
        $.get( url );
      }
    });
  });