2012-04-10 38 views
0

我有以下标记,并希望在这之后放置'这是我的信息',此时触发ajax回调。我的标记:在数据元素结束时放置内容 - 如何选择数据元素

<div data-item-header-id="17"> 
here is an item 
</div> 
<div data-item-header-id="17"> 
here is another item 
</div> 
<!-- put 'here is my info here' here --> 
<div data-item-header-id="18"> 
here is another item 
</div> 

警报被调用,但没有放在正确的位置。我如何选择上述标记?

if(r.is_placed_at_end=='true'){ 
    alert('will place at end'); 
    $('data(item-header-id==17):last)').after("here is my info"); 
} 

我试着看着这个,但并没有让我一路在那里。 jquery data selector

此外,数据元素的这种正确使用?

thx

回答