Hi
I inherited this jQuery code;
- jQuery("#login-form").submit(function(){
- var str = jQuery(this).serialize();
- jQuery.ajax({
- type: "POST",
- url: "includes/login-send.php",
- data: str,
- success: function(msg)
- {
- jQuery("#formstatus").ajaxComplete(function(event, request, settings){
- if(msg == 'OK'){
- window.location.href = "index.php";
- } else{
- var openingTag='<div class="formstatuserror">';
- var closingTag="</div> ";
- result = openingTag.concat(msg,closingTag);
- }
- jQuery(this).html(result); <===== Error here
- });
- }
- });
- return false;
- });
I am getting '0x800a1391 - JavaScript runtime error: 'result' is undefined' error on;
- jQuery(this).html(result);
What am I doing wrong?
Thanks