XHar följande kod:
Klickar jag på knappen som anropar detta så kommer jConfirm upp och jag trycker på OK för att radera. Men verkar bara som att den kör beforeSend då. Klickar jag igen direkt efter på radera igen då kör den beforeSend och success men den kör aldrig dessa två:
Alertrutorna kommer upp! Någon som ser något fel i denna koden?
Code:
$(document).ready(function() {
$('.stcommentdelete').die('click').live("click",function() {
var ID = $(this).attr("id");
var dataString = 'com_id='+ ID;
jConfirm('Sure you want to delete this comment??? There is NO undo!', '',
function(r) {
if(r==true){
$.ajax({
type: "POST",
url: "comment_delete_ajax.php",
data: dataString,
cache: false,
beforeSend: function(){
alert("Före-"+ID);
$("#stcommentbody"+ID).animate({'backgroundColor':'#fb6c6c'},300);
},
success: function(html){
alert("KLAR-"+ID);
$("#stcommentbody"+ID).fadeOut(300,function(){$("#stcommentbody"+ID).remove();});
}
});
}
});
return false;
});
});
Code:
$("#stcommentbody"+ID).animate({'backgroundColor':'#fb6c6c'},300);
$("#stcommentbody"+ID).fadeOut(300,function({$("#stcommentbody"+ID).remove();});
{

Comment