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

0

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>
    
asked by anonymous 05.07.2016 / 16:56

3 answers

1

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

Try this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script><scriptsrc="CAMINHO_DO_BOOTSTRAP.MIN.JS_AQUI"></script>
<script type="text/javascript">
    $(document).ready(function() {
   $('#myModal').modal('show');
});
</script>
    
06.07.2016 / 16:17
1

Make a jQuery call after loading the page, like this:

$(document).ready(function(){
    $('#modal').modal('show');
});
    
05.07.2016 / 17:02
0

<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>
    
05.07.2016 / 19:29