php - 数据模式对话框不显示

标签 php mysql

我创建了一个按钮,单击该按钮即可查看车辆详细信息。但是,我的数据模式对话框没有显示。这是我的代码..

<table class="table table-striped">  
                                          <tr>  
                                               <th width="40%">Plate Number</th>
                                               <th width="30%">Type</th>  
                                               <th width="30%">View</th>  
                                          </tr>  
                                          <?php  
                                          while($row = mysqli_fetch_array($result))  
                                          {  
                                          ?>  
                                          <tr>  
                                               <td><?php echo $row["plateNo_vehicle"]; ?></td> 
                                               <td><?php echo $row["vehicle_Type"];?></td> 
                                               <td><input type="button" name="view" value="view" id="<?php echo $row["id_vehicle"]; ?>" class="btn btn-info btn-xs view_data" /></td>  
                                          </tr>  
                                          <?php  
                                          }  
                                          ?>  
                                     </table>  

这是模态类和脚本。该脚本应该包含应该查看所有车辆详细信息的ajax,但我更改它只是为了弹出一个数据模式对话框,因为数据模式根本不会显示。

<div id="dataModal" class="modal fade">  
  <div class="modal-dialog">  
       <div class="modal-content">  
            <div class="modal-header">  
                 <button type="button" class="close" data-dismiss="modal">&times;</button>  
                 <h4 class="modal-title">Vehicles Details</h4>  
            </div>  
            <div class="modal-body" id="vehicle_detail">  
            </div>  
            <div class="modal-footer">  
                 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>  
            </div>  
       </div>  
  </div>  

脚本

<script>
$(document).ready(function(){
    $('.view_data').click(function(){
        $('#dataModal').modal("show");
    });
});

最佳答案

您似乎加载了两次 jQuery。

第一例:<script src="../vendor/jquery/jquery.min.js"></script>

第二个实例:<script src="ajax.googleapis.com/ajax/libs/jquery/2.2.0/…

这可能会导致冲突。仅坚持使用最新版本。

关于php - 数据模式对话框不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43221216/

相关文章:

php - Apache + socketIO 失败

php - MySQL 导出导入,外键 ID 自动递增

php - 使用 PHP 从 MySQL 数据库检索 Blob 图像

php - 如何在弹出窗口中垂直显示结果

mysql - 使用 Perl DBI Mysql 在查询中获取最大行字符长度

python - 带有多表查询的SQL的Django views.py版本

MySQL 查询很慢(连接/计数)

php - PHP中的数据库事务回滚处理

mysql - 外部数据库连接被阻止的解决方法

mysql - 如何在使用 "group by"子句时优化 mysql 中的查询?