Hello
In this code, $.ajax function worked , but success: function(html) does not work(document.getElementById).
I do not know why it does not work!? What do I do?
$(".submit").click(function(){
var entry_id = $("#entry_id").val();
var comment_body = $("#comment_body").val();
var comment_name = $("#comment_name").val();
var comment_email = $("#comment_email").val();
var comment_url = $("#comment_url").val();
var dataString = 'entry_id=' + entry_id + '&comment_body=' + comment_body + '&comment_name=' + comment_name + '&comment_email=' + comment_email + '&comment_url=' + comment_url;
if (comment_body == '' || comment_name == '' || comment_email == '' || comment_url == '') {
alert('Please Give Valide Details');
}
else {
$("#flash").show();
$("#flash").fadeIn(400).html('<span class="loading">لطفا منتظر بمانید...</span>');
$.ajax({
type: "POST",
url: "/zig-co/blog/comment_insert",
data: dataString,
cache: false,
success: function(html){
var s1 = document.getElementById('comment_body');
var s2 = document.getElementById('comment_name');
var s3 = document.getElementById('comment_email');
var s4 = document.getElementById('comment_url');
$("#update").append(html);
$("#update li:last").fadeIn("slow");
s1.value + s2.value + s3.value + s4.value;
$("#name").focus();
$("#flash").hide();
}
});
}
return false;
});