Javascript 使用图标并删除图标微调器图标微调

Javascript 使用图标并删除图标微调器图标微调,javascript,jquery,twitter-bootstrap,fonts,Javascript,Jquery,Twitter Bootstrap,Fonts,我有一个问题,我不能删除一个附加图标,一旦它有图标旋转类 <h1>This is the title</h1> <script> function updateByAjax() { $h1 = $('h1').append('<i class="icon-spinner icon-spin"></i>') $.get('/url', function(resp) { $h1.html(resp.tit

我有一个问题,我不能删除一个附加图标,一旦它有
图标旋转

<h1>This is the title</h1>

<script>
  function updateByAjax() {
    $h1 = $('h1').append('<i class="icon-spinner icon-spin"></i>')
    $.get('/url', function(resp) { 
      $h1.html(resp.title).find('.icon-spinner').remove()
    })
  }
</script>
这是标题
函数updateByAjax(){
$h1=$('h1')。追加(“”)
$.get('/url',函数(resp){
$h1.html(resp.title).find('.icon微调器').remove()
})
}

解决此问题的方法是用另一个标记环绕微调器

<h1>This is the title</h1>

<script>
  function updateByAjax() {
    $h1 = $('h1').append('<span class='ajax-wait'><i class="icon-spinner icon-spin"></i></span>')
    $.get('/url', function() { 
      $h1.html(resp.html).find('.ajax-wait').text('').remove() 
    })
  }
</script>
这是标题
函数updateByAjax(){
$h1=$('h1')。追加(“”)
$.get('/url',函数(){
$h1.html(resp.html).find('.ajax wait').text('').remove()
})
}