search

Home  >  Q&A  >  body text

The reason why there is no response when you press the button may be because the () and {} positions near the asynchronously submitted function are wrongly matched. This is how I wrote it.

$(function(){

$("#login").on('click',function(event){

$.ajax({

type: "POST", //The submission method is POST

url:"{:url('checkLogin')}", //Set the address of the script file for submitting data processing

data:$("form").serialize(), //Serialize the data of the current form and submit it later

dataType:'json', //Set the type of submitted data to json

success:function(data){ //Only if the return flag is 1, it will be processed

alert(data.status);

}

})

})

})


熟悉使用PHP9的Spidey熟悉使用PHP9的Spidey2457 days ago1204

reply all(1)I'll reply

  • 熟悉使用PHP9的Spidey

    熟悉使用PHP9的Spidey2018-04-15 19:08:12

    You can click to see

    reply
    3
  • Cancelreply