At the moment the following code will load only when the users clicks the link.
I want on load of the page this to happen without the user having to click.
<script>
$(document).ready(function() {
// Support for AJAX loaded modal window
$(document).on('click', '.btn-modal', function() {
$.get($(this).attr('data-target'), function(data) {
$('#modal').html(data);
$('#modal').modal('show');
}, 'html');
});
});
</script>
<!-- Modal window to load dynamic content -->
<div class="modal hide fade customDialog" id="modal"></div>
<a class="btn btn-modal" data-target="page.html" >Launch Modal</a>
1 Answer