我做錯了什麼? #contactImg沒有得到通過jQuery - image SRC
var clickedImage = $('img.img_rightThumb').attr("src");
$('#contactImg').attr('src', clickedImage);
OK我想選擇是壞的SRC ...但我不知道怎樣......
<? if ($this->profile['has_user_image']) { ?>
<img src="/images/users/<?= $this->profile['user_image'] ?>" width="114" class="img_rightThumb">
<? } else { ?>
<img src="/images/avatar.png" width="114" height="86" class="img_rightThumb">
<? } ?>
看起來是對我的。我們可以看到html嗎? –
由於我們不知道PHP在做什麼以及它生成的實際HTML是什麼,所以頁面中實際HTML的相關部分會更好。 – jfriend00
你在頁面加載成功後運行你的jQuery嗎?或者在'img.img_rightThumb'還沒有運行之前運行它? – jfriend00