<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 '];
}
}
张**2018-08-17 08:04:06
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
phpcn_u2285602018-06-23 13:59:09
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 2018-06-20 10:20:43
Hello, I have the same problem. Ajax is not executed. I don’t know what’s going on?
无忌哥哥2018-06-14 10:55:36
Check the console for specific ajax errors. You can also see specific errors in the thinkphp log.