Modal of bootstrap does not open

1

Good, I'll leave my code here, I checked and nothing, I do not know why it does not work I thought it was something that had written the script wrong but I do not know why it does not work and I copied it from the bootstrap page just changing the id.

File index.php

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Bootstrap -->
<link rel="stylesheet" type="text/css" href="librerias/bootstrap/css/bootstrap.css">
<!-- Alertify -->
<link rel="stylesheet" type="text/css" href="librerias/alertify/css/alertify.css">
<link rel="stylesheet" type="text/css" href="librerias/alertify/css/themes/default.css">

<!-- CSS propio -->
<link rel="stylesheet" type="text/css" href="css/main.css">

<!-- FontAwsome -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<!-- alertify, jquery y bootstrap JS -->
<script src="librerias/jquery/jquery-3.2.1.min.js"></script>
<script src="librerias/bootstrap/js/bootstrap.js"></script>
<script src="librerias/alertify/alertify.js"></script>


<title>Visualización de la Base de Datos NAW</title>
</head>
<body>

<div class="container">
    <div id="tabla"></div>
</div>

    <!-- Modal para registros nuevos -->


    <div class="modal fade" id="modalNuevo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">Agrega nueva persona</h4>
        </div>
        <div class="modal-body">
            <label>Nombre</label>
            <input type="text" name="" id="nombre" class="form-control input-sm">
            <label>Apellido</label>
            <input type="text" name="" id="apellido" class="form-control input-sm">
            <label>Email</label>
            <input type="text" name="" id="email" class="form-control input-sm">
            <label>telefono</label>
            <input type="text" name="" id="telefono" class="form-control input-sm">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-primary" data-dismiss="modal" id="guardarnuevo">
          Agregar
          </button>

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

  <!-- Modal para edicion de datos -->

  <div class="modal fade" id="modalEdicion" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog modal-sm" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">Actualizar datos</h4>
        </div>
        <div class="modal-body">
            <input type="text" hidden="" id="idpersona" name="">
            <label>Nombre</label>
            <input type="text" name="" id="nombreu" class="form-control input-sm">
            <label>Apellido</label>
            <input type="text" name="" id="apellidou" class="form-control input-sm">
            <label>Email</label>
            <input type="text" name="" id="emailu" class="form-control input-sm">
            <label>telefono</label>
            <input type="text" name="" id="telefonou" class="form-control input-sm">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-warning" id="actualizadatos" data-dismiss="modal">Actualizar</button>

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

</body>
</html>

<!-- Jquery en el cual llamamos a la tabla -->
<script type="text/javascript">
$(document).ready(function(){
     $('#tabla').load('components/tabla.php');
});
</script>

File table.php

<!-- Titulo con clase de bootstrap -->
<h1 class="display-4" id="titulo"> Visualización de Datos</h1>

<div class="row">
<div class="col-sm-12">
    <caption>
      <button class="btn btn-primary"  data-toggle="modal" data-target="#modalNuevo" id="margen_inf"> Agregar Nuevo
          <span class="fa fa-plus-circle"></span>
      </button>
     </caption>

<!-- Table-hover sombrea celdas -->
<!-- table-condensed para que se vea mas comprimido -->
<!-- Parezca una celda la tabla -->
<table class="table table-hover table-condensed  table-bordered"> 

<tr>
  <td>ID</td>
  <td>Nombre y Apellido</td>
  <td>Teléfono</td>
  <td>Correo</td>
  <td>Comuna</td>
  <td>Creado</td>
  <td>Actualizado</td>
  <!-- Columnas extra para edición y eliminación -->
  <td>Editar</td>
  <td>Eliminar</td>
</tr>

<!-- Para ser llenado por PHP -->
<tr>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <!-- Editar y Eliminar -->
  <td>
   <button class="btn btn-warning fa fa-pencil" data-toggle="modal" data-target="#modalEdicion" ></button>
  </td> 
  <td>
   <button class="btn btn-danger fa fa-trash"></button>
  </td>
</tr>
</table>
</div>
</div>
    
asked by Naoto 06.09.2017 в 23:23
source

1 answer

0

The answer is:

I had downloaded the "Compiled CSS and JS" bootstrap and in developer mode (inspecting elmento right click on my button just in case) I saw that something was missing from the popper.js that bootstrap was missing so I downloaded the bootstrap that has everything like without compiling "Source files" and take out the popper.min.js from there (in the path: bootstrap-4.0.0-beta.zip \ bootstrap-4.0.0-beta \ assets \ js \ vendor ) and call it from my index.php before the bootstrap script () and already: D

I explain so if there is a rookie like me hehe

    
answered by 07.09.2017 / 15:58
source