0
我有幾個具有唯一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>
我對旋轉click事件看起來是這樣的:
$('.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
}
});
});
我剛加入的ID給img標籤來完成這項工程。謝謝! – Paul 2012-07-10 00:37:53