Skip to content

Instantly share code, notes, and snippets.

@abcprintf
Last active July 14, 2020 03:38
Show Gist options
  • Save abcprintf/2b1c359e860bbd7fd6c376ade3445fd0 to your computer and use it in GitHub Desktop.
Save abcprintf/2b1c359e860bbd7fd6c376ade3445fd0 to your computer and use it in GitHub Desktop.
Bootstrap3 remote modal

html

<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content"></div>
  </div>
</div>

js

$('#myModal').removeData('bs.modal');
$('#myModal').modal({
    remote: 'url'
});
$('#myModal').modal('show');

url

<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-default" data-dismiss="modal">Close</button>
  <button type="button" class="btn btn-primary">Save changes</button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment