search

Home  >  Q&A  >  body text

There is no response when I click to log in at about 2 minutes and 55 seconds, and there is no problem with the code.

public function checkLogin(Request $request)

{

//Initial return parameters

$status = 0;

$result = ' ';

$data = $request -> param();


return ['status'=>$status, 'message'= >$result, 'data'=>$data];

}

$(function(){

//Add a click to the login button Event

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

$.ajax({

type: "POST",

url: "{:url('checkLogin')}",

data: $("form").serialize(), //Serialize the current form data before submitting it

dataType: 'json',

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

alert (data.status);

}

});

})

})


##

黄子乐黄子乐2637 days ago1418

reply all(10)I'll reply

  • 苦橙。

    苦橙。2017-11-16 11:48:12

    It doesn’t work when I click to log in here. Can you help me take a look?

    Public Function Checklogin (Request $ Request)

    {

    ## // Initialization Back parameters

    $ Status = 0;

    # $ result ='';

    $data = $request->param();

    return ['status'=>$status,'message'=>$result,' data'=>$data];

    }

    $(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

    data:$("form").serialize(),//Serialize the data submitted by the current script and then submit it

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

    success:function(data){

    alert(data);

    }

    });

    })

    })

    reply
    0
  • 酱油哎呦

    酱油哎呦2017-11-07 21:54:23

    Handsome guy, the semicolon there, I have the same problem

    reply
    0
  • 黄子乐

    $rule = [ 'name'=>'require', 'password'=>'require', 'verify'=>'require|captcha' ];The last semicolon

    黄子乐 · 2017-11-07 21:57:35
    酱油哎呦

    Reply Huang Zile: I found it. Anyway, thank you.

    酱油哎呦 · 2017-11-07 22:15:28
    黄子乐

    Haha, it’s almost done anyway. I’m exhausted after searching for a long time, but I still don’t have a solid foundation. . .

    黄子乐 · 2017-11-07 22:16:45
    苦橙。

    Dude, have you found the problem?

    苦橙。 · 2017-11-16 12:03:29
    酱油哎呦

    doge/..This is two minutes and 55 seconds. I didn’t even hit you.

    酱油哎呦 · 2017-11-07 22:01:04
  • 黄子乐

    黄子乐2017-11-07 21:44:31

    Already found it. I just accidentally missed a semicolon. Sorry to trouble everyone. . .

    reply
    0
  • 一个华安丶两只眼

    What's going on? Mine won't pop up either. What's the problem?

    一个华安丶两只眼 · 2017-11-21 20:20:48
    咿呀咿呀哟

    I also want to know what's going on. Mine can't pop up, and nothing happens when I click to log in.

    咿呀咿呀哟 · 2018-02-26 10:16:27
  • Cancelreply