Jquery $(…)。模式不是函数

Jquery $(…)。模式不是函数,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,这是我导入脚本和css时.php的 <!--JQUERY--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"> </script> <!--JQUERY-UI--> <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></scr

这是我导入脚本和css时.php的

<!--JQUERY-->
<script       src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js">       </script>
<!--JQUERY-UI-->
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet"   href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<!-- BS JavaScript -->
<script type="text/javascript" src="js/bootstrap.js"></script>
<!--CSS BOOTSTRAP-->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- SIDEBAR CSS -->
<link href="../css/simple-sidebar.css" rel="stylesheet">
<!--Modal Form-->
<?php include "modal_form_detalle_parteMantenimiento.php"; ?>
模态形式是简单的html:

<!DOCTYPE html>
<div id="pintarAsiTot">
<html lang="en">

<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

</head>

<body>
<!-- Modal -->

<div class="modal fade" id="detalleParteMantenimiento" tabindex="-1" role="dialog" 
 aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <!-- Modal Header -->
        <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal">
                   <span aria-hidden="true">&times;</span>
                   <span class="sr-only">Close</span>
            </button>
            <h4 class="modal-title" id="myModalLabel">
                Detalle Parte Mantenimiento
            </h4>
        </div>

        <!-- Modal Body -->
        <div class="modal-body">

            <form class="form-horizontal" role="form">
              <div class="form-group" id="contenidoDetalleMant">                            




                </div>



              </div>
              <!-- Modal Footer -->
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">CERRAR</button>
            </div>

            </form>

        </div>


    </div>
</div>
</div>

</body>

</html>


</div>

&时代;
接近
曼特尼米恩托广场酒店
塞拉
问题是当我点击按钮时,并没有打开表单。什么?

首先,模态ID是detallepartemanteniemento而不是contendodetallemant,请尝试更改它

如果这不起作用,我会检查Jquery是否正确加载,或者是否加载了两次,也许它包含在布局页面中

解决方法

您可以添加一个隐藏按钮,如下所示:

<button type="button" id="btnToOpenModal" style="display:none" data-toggle="modal" data-target="#detalleParteMantenimiento"> </button>

$(“[name=detalles]”)可以正常工作,但ajax请求已经实现。您可以对jquery ui进行注释并运行它,看看它是否修复了,如果没有,请尝试查看jquery没有加载两次。jquery-ui已恢复,并且不打开模式。您能否创建一个JSFIDLE:现在不可能,抱歉。
<button type="button" id="btnToOpenModal" style="display:none" data-toggle="modal" data-target="#detalleParteMantenimiento"> </button>
$(document).ready(function(){
                       var id_clickat=0;
                       $('[name=detalles]').click(function(){
                           id_clickat = $(this).val();

                            $.post( "../php/ajaxParteMantenimiento.php",{id_c : id_clickat, mostrar : true}, function( data )                           
                    {    
                        $("#contenidoDetalleMant").html(data);
                        $("#btnToOpenModal").click();
                    });
                       });
                   });