I have my code here that inserts predefined modal markup at the end of the body:
var languageModal = '<div id="lngModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="lngModalLabel" aria-hidden="true">'+ ' <div class="modal-body"></div>'+ ' <div class="modal-footer">'+ ' <form class="inline" id="lngModalForm">'+ ' <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">'+ ' <span lang="hu"'+((langAfterInit == 'hu') ? '' : ' style="display:none;"')+'>Bezรกrรกs</span>'+ ' <span lang="en"'+((langAfterInit != 'hu') ? ' style="display:none;"' : '')+'>Close</span>'+ ' </button>'+ ' </form>'+ ' </div>'+ '</div>'; $('body').append(languageModal);
But, when I find .modal() on it, it will not load, only a black overlay appears:
$('#lngModal').modal({ backdrop : 'static', keyboard : false, remote : '/language.html', });
I tried with .on('modal',{...}) , but that didn't work.
source share