The below script is perfectly working fine. The problem is even if the callback function is true but it's not ececuting "if (data == 'true') {" function. Advise me.
<script>
function
SendDataemail() {
$.ajax({
type: "POST",
async: false,
url: $("#emailsubmit").attr('action'),
data: $("#emailsubmit").serialize(),
success: function (data, jqXHR, textStatus) {
alert(data);
if (data == 'true') {
//alert(data);
alert("working");
$('#emailsubmit').fadeOut('fast');
} else if (data == 'false') {
//alert(data);
$('#new_thumb').remove();
$('#statusform')
.append('<div id="new_thumb" style="padding:20px;">' + data + '</div>');
$("#statusform").popup("open")
} else {
alert("none");
}
postemail.cshtml
@{ Layout = null ; } true