ダウンロードのボタンがあり、クリックすると要素スパンのテキストが変更されるはずですが、ajax部分に問題があります
クリックすると小さなボタンが表示され、テキストは変更されません
ここに私のhtmlがあります
//somecode
<span class="num">Downloaded:<?php echo $downloadcount;?></span>
</td></tr>
</table>
</div>
<button type = "button" class="button" id="<?php echo $id; ?>" name="dl">
<a href='./mp3/<?php echo basename($filename);?>'>Download</a>
</button>
</td>
</tr>
</table>
ここに私のajaxがあります:
$(function() {
$(".button").click(function()
{
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
if(name=='dl')
{
$(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">');
$.ajax({
type: "POST",
url: "download_number.php",
data: dataString,
cache: false,
success: function(html)
{
//THE PROBLEM IS HERE
$(".num").text(html);
} });
}
});
});
私も試しました$(".num").html(html);