Problem: Ajax Return false is not returning false, the codes values are being put witin the address bar, and the page is being refreshed.
Question: Did I put the return false in the wrong area? How can I fix this problem?
AJAX
$(".status_reply").click(function() {
var status_id = $("input[name=status_id]").val();
var user_id = $("input[name=user_id]").val();
var reply_id = $("input[name=reply_id]").val();
var whoto = $("input[name=whoto]").val();
var from = $("input[name=from]").val();
var date = $("input[name=date]").val();
var reply = $("textarea#reply_value").text();
var dataString = 'status_id='+ status_id + '&user_id=' + user_id + '&reply_id=' + reply_id + 'whoto='+ whoto + '&from=' + from + '&date=' + date + '&reply=' + reply;
// alert (dataString);return false;
$.ajax({
type: "POST",
url: "home/status_reply",
data: dataString,
success: function() {
$.ajax({
url: 'home/update_replies/'+status_id,
data: "html",
success: function(data) {
var newComment = $('<div>').html(data);
$('#ajax-comments').after(newComment).fadeIn('slow');
return false;
}
});
return false;
}
});
});//end of button click