if(username != null || password != null){ var e = jQuery("#submit-btn"), t = jQuery("#physiotec-loading"); e.hide() t.show() physiotecLogin( jQuery("#username").val(), jQuery("#password").val(), function (e) { document.location.href = secondPage + e; }, function () { e.show(), t.hide(), alert("Invalid Credentials"); } ) }