我有几个具有唯一 ID 的 div 标签,在特定图像的点击事件之后,我试图刷新它。我怎样才能做到这一点?到目前为止,这就是我的代码:
HTML:
<div class="photo_gallery_container" <?php echo($div_id); ?>>
<table class="table table-bordered table-condensed">
<thead >
<tr style="background-color: #f5f5f5;">
<th colspan="2" style="text-align: right;"><span style="cursor:pointer" id="delimg_<?php echo($id); ?>" class="delimg"><span class="label label-important">Delete</span></span></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<img src="<?php echo($url['url'])?>" style="height:120px;"/>
</td>
<td>
<a href="#" id="rotateimg_<?php echo($id); ?>" class="rotateimg">Rotate</a>
</td>
</tr>
</tbody>
</table>
</div>
我的旋转点击事件如下所示:
$('.rotateimg').click(function(e) {
e.preventDefault();
var id = $(this).attr('id').substr(10);
$.post("/functions/photo_functions.php", { f: 'rotate', imgid: id }, function(status){
if (status == 'true') {
// How can I reload the specific image after being rotated
}
});
});