我有這樣的重複代碼。使用jquery從頁面上的許多重複類中獲取特定元素
<div class='commentfloatleft'>
<button type='button' class='button2' onclick='upvote($id8)'>
<img src='images/likebutton.png' class='upvoteimage' width='12' height='12' alt='PearlSquirrel'/>
</button>
<button type='button' class='button2' onclick='downvote($id8)'>
<img src='images/unlikebutton.png' width='12' height='12' alt='PearlSquirrel'/>
</button>
</div>
當我點擊了給予好評的onclick代碼是這樣的:
function upvote(box){
$(this).siblings('.upvoteimage').load('upvote.php?box=' + box);
}
我想盡一切辦法得到這個工作。 get函數正在工作,但在「.upvoteimage」中看不到任何更改。有誰知道如何解決這個問題。幫助將不勝感激。謝謝。
獲得按鈕解僱他們需要通過'
' – ClydeFrog不真實的包圍,這只是爲了讓形式解僱。 –
他已經有(內聯,不是最佳實踐,但它的工作原理) –