dongliang2058 2017-04-05 03:21
浏览 6
已采纳

数据模式对话框未显示

i have created a button that will view the vehicles details when clicked. how ever, my data modal dialog does not show up. here is my codes..

<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>  

this is the modal class and the script. the script supposed to contain ajax that supposed to view all the vehicle detail but i changed it just to pop up a data modal dialog only because the data modal wont show up at all.

<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

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

  • 写回答

2条回答 默认 最新

  • douchuang1852 2017-04-05 04:24
    关注

    It seems like you're loading jQuery twice.

    First instance: <script src="../vendor/jquery/jquery.min.js"></script>

    Second instance: <script src="ajax.googleapis.com/ajax/libs/jquery/2.2.0/…

    this may be causing conflicts. Stick with the latest version only.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害