我正在尝试在模态对话框中打开一个URL。我认为这很简单,但似乎已经陷入了第一道障碍..有谁能看出为什么这不起作用?对话框正在打开,但网页没有出现在内部..感谢您的帮助:D
<a href='http://www.google.co.uk' class='ls-modal'>Login</a>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Event</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
//JS script
$('.ls-modal').on('click', function(e){
e.preventDefault();
$('#myModal').modal('show').find('.modal-body').load($(this).attr('href'));
});