search

Home  >  Q&A  >  body text

Why doesn't it work when running the ajax request? I want to implement the registration function but I can't.

image.png

script

<!-- ajax submits the current form-->
<script type="text/javascript">
$(function(){
          $('#register').on('click',function(){
                                                use  -- to submit user information
                    $.ajax({
                                                             'post',
          url: "{:url('insert')}&q

public function insert()
{ //The front-end submission must be an Ajax request and then verify and add new operations
if (Request::isAjax()) {
//1. Data verification
          $data = Request::post(); //Data to be verified
           $rule = 'app\common\validate\User';  //Customized validator

                   

1907 days ago1131

reply all(1)I'll reply

  • A峰

    A峰2019-12-02 18:09:50

    Let’s see what error the system reports when making a request

    reply
    0
  • Cancelreply