Home  >  Article  >  Backend Development  >  javascript - html uses js validation causing ajax submission to fail

javascript - html uses js validation causing ajax submission to fail

WBOY
WBOYOriginal
2016-08-04 09:22:131074browse

I used js to do form verification, but the subsequent ajax submission did not respond.

Excuse me, what is the problem? Thank you

Reply content:

I used js to do form verification, but the subsequent ajax submission did not respond.

Excuse me, what is the problem? Thank you

This part of you

$(function(){
     var my_data=new Array();
     $.ajax({
         url: "sql.php",  
         type: "POST",
          data:{trans_data:right},
         //dataType: "json",
         error: function(){  
             alert('Error loading XML document');  
         },  
         success: function(data,status){//如果调用php成功  

             alert('data');
         }
     });
 });

changed to

     var my_data=new Array();
     $.ajax({
         url: "sql.php",  
         type: "POST",
          data:{trans_data:right},
         //dataType: "json",
         error: function(){  
             alert('Error loading XML document');  
         },  
         success: function(data,status){//如果调用php成功  

             alert('data');
         }
     });
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn