Why does my ajax keep calling error! ! ! ! !
阿荣
阿荣 2018-06-13 21:48:39
0
8
1409

<script type="text/javascript">
$(function(){
$('#register').on('click',function(){
) // Use ajax to submit user information
.           },
                error: function (data)
                                                                                                                                                    
gt;




Background method:

public function insert()
{
if(Request::isAjax()){
$data = Request::except ('password_confirm','post');
if(UserModel::create($data))
{
          return ['status'=>1,'message'=>'Registration successful '];

                                                                       return ['message'=>'Operation failed',''status'=> >error('Request type error','register');

}
}

阿荣
阿荣

reply all(7)
一粒红尘

Just change the submit button on the page to button!

张**

I also encountered this situation, and later found out that it was related to the browser. The Firefox I used at first didn’t work, but after switching to Google, it became ok

  • reply md suddenly stopped working again, and even changing the browser didn't work.
    张** author 2018-08-17 08:21:24
SuperTizzy

Change the submit button on the page to button

phpcn_u228560

Database debugging is turned on, and app debugging is turned on. Go directly to the insert page to check the problem. Create a test controller and write a data array create.

 Jensen

Hello, I have the same problem. Ajax is not executed. I don’t know what’s going on?

Summer

There may be a problem with the requested data type

无忌哥哥

Check the console for specific ajax errors. You can also see specific errors in the thinkphp log.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!