Error in Close button selector
Try this
$(document).ready(function () {
$("#login").click(function () {
$("#ajax-login-form").submit(function () {
var str = $(this).serialize();
$.ajax({
type: "POST",
url: "functions/login.php",
data: str,
success: function (msg) {
if (msg == 'OK') {
$('#modalBox').hide(); // This line works fine.
$('#loginForm').hide(); // This line works fine.
$('#closeIt').click(); // This will work.
$('#closeIt').trigger('click'); // This will work.
location.reload(); //Some problems
} else {
$("#note").html(msg); // This line works fine.
}
}
});
return false;
});
});
});