Code:
$(function()
{
$('.more').live("click",function() {
var ID = $(this).attr("id");
if(ID)
{
$("#more"+ID).html('<img src="moreajax.gif" />');
$.ajax({
type: "POST",
url: "scripts/file.php",
data: { lastmsg: ID, whatever: someValue },
cache: false,
success: function(html){
$("span#updates").append(html);
$("#more"+ID).remove(); // removing old more button
}
});
}
else
{
$(".morebox").html('The End');// no results
}
return false;
});
});
That syntax should work, what are you trying to get work?