JQuery or Bootstrap Modal that receives email and name, displayed automatically when loading the page

I tried the following code, but it is not working

<script type="text/javascript">
	$(document).ready(function() {
   $('#myModal').modal('show');
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<div id="myModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      Conteudo
    </div>
  </div>
</div>
Author: Rafael Rotiroti, 2016-07-05

3 answers

The problem is that you are calling the jquery.min.js after the code.

Try This:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<script src="CAMINHO_DO_BOOTSTRAP.MIN.JS_AQUI"></script>
<script type="text/javascript">
    $(document).ready(function() {
   $('#myModal').modal('show');
});
</script>
 1
Author: Luiz Gonçalves, 2016-07-06 14:17:40

Makes a jQuery call after the page loads, like this:

$(document).ready(function(){
    $('#modal').modal('show');
});
 1
Author: Bruno Bermann, 2016-07-05 15:02:20

<div id="#modal">
<div class="modal fade">
  <div class="modal-dialog" 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">Modal title</h4>
      </div>
      <div class="modal-body">
        <p>One fine body&hellip;</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<style>
$(document).ready(function(){
   **texto em negrito**     $('#modal').modal('show');
});
</style>
 0
Author: Rafael Rotiroti, 2016-07-05 17:29:16