$(document).ready(function() { //console.log('hi'); $('.loginFormButton').click(function() { var vals = $(this).parent().find('input, select, textarea').serialize(); $.ajax({ type: 'POST', url: 'https://www.nhasea.org/Components/Member/Assets/AJAX/LogIn.php', dataType : 'text', // data type data : vals, success: function(msg){ var ret = msg.split('::'); if (ret[0] == 1) { $('#loginMessage').html('
Login Successful
'); setTimeout( function(){ //window.location.href = 'https://www.nhasea.org/members'; window.location.href = $('.loginURL').val(); }, 1000); } else { $('#loginMessage').html('
'+ret[1]+'
'); } } }); }); });