The navigation bar I downloaded directly from bootstrap also introduced jquery.js. Why can't I click on the drop-down menu?
走过沙漠的骆驼
走过沙漠的骆驼 2021-09-19 11:26:02
0
3
762
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{$title|default="页面标题"}</title>
<link rel="stylesheet" href="/static/css/bootstrap.css">
<script type="/static/js/jquery-3.6.0.min.js"></script>
<script type="/static/js/bootstrap.min.js"></script>
</head>
<body>

The navigation bar I downloaded directly from bootstrap also introduced jquery.js. Why can’t I click on the drop-down menu?

And my ajax used for registration verification also passed. Where did I go wrong?

走过沙漠的骆驼
走过沙漠的骆驼

reply all(1)
猪老湿

What is the console error message? Are all external scripts imported correctly?

  • reply Teacher, there is no response or prompt when I click the pull-down button.
    走过沙漠的骆驼 author 2021-09-21 15:41:14
  • reply Teacher, the drop-down problem is caused by the introduction of js and has been solved. $(function(){ $("#register").on('click',function(){ alert($('#login').serialize()); }) }) $(function(){ $("#register").on('click',function(){ $.ajax({ type:'post', url:"{:url('index/user/insert')}", data:$('#login').serialize(), dataType:'json', success:function(data){ alert('successful'); } }) }) }) But when I insert the registration data, the first script can pop up a prompt box with submitted data, but the following script cannot succeed and there is no prompt message? Ask the teacher to help. Below are the insert questions, I followed them as written. public function insert() { if(Request::isAjax()){ //Use model to create data //Get the data submitted by the user through the form //data is a variable used to obtain data, it is an array $data = Request::except('password_confirm','post'); if(UserModel::create($data)){ return['status'=>1,'message'=>'Congratulations, registration is successful']; }else{ return['status'=>0,'message'=>'Registration failed, please check']; } }else{ $this->error("Request type error",'register'); } }
    走过沙漠的骆驼 author 2021-09-22 16:16:02
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template