试图用jQuery加载grunticons

时间:2015-09-24 15:42:32

标签: jquery svg

我正在使用gem will_paginate并尝试用grunticon图标替换Previous和Next文本。它在页面加载时起作用,但是,当我单击加载下一页时插入span元素,图标不显示,并且没有加载任何svg数据。

我不知道为什么这会给我这样的问题。感谢您提供的任何见解。

我的jQuery

$('document').ready(function(){
  $('.pagination .previous_page').html('<span class="icon-chevron-left" data-grunticon-embed></span>');
  $('.pagination .next_page').html('<span class="icon-chevron-right" data-grunticon-embed></span>');
});

HTML

<div class="pagination">
  <a class="previous_page" rel="prev start" href="/promotion/show/52671?page=1">
    <!--jQuery inserts span here-->
    <span class="icon-chevron-left" data-grunticon-embed></span>
  </a> 
  <a rel="prev start" href="/promotion/show/52671?page=1">1</a> 
  <em class="current">2</em> 
  <a rel="next" href="/promotion/show/52671?page=3">3</a> 
  <a class="next_page" rel="next" href="/promotion/show/52671?page=3">
    <!--jQuery inserts span here-->
    <span class="icon-chevron-right" data-grunticon-embed></span>
  </a>
</div>

0 个答案:

没有答案