bootstrap-3 – How to open external URL in bootstrap modal?


I already use the bootstrap modal and it worked very well for the content I tested. But I can't find anything that explains how to open an external page in a modal on the site. Does anyone know how to do it? I am grateful for the help!


<a data-toggle="modal" class="btn" href="" data-target="#myModal">click me</a>

<div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Modal header</h3>
  <div class="modal-body">


$('a.btn').on('click', function(e) {
    var url = $(this).attr('href');
    $(".modal-body").html('<iframe width="100%" height="100%" frameborder="0" scrolling="yes" allowtransparency="true" src="'+url+'"></iframe>');

in case you will have to use an iframe see working in jsfidle:

Scroll to Top