calling Modal in JAVA / Script not working in modal

Sometimes JS/ Jquery doesn't work in the modal when you  call it  on a button by onclick() or any other method.
i.e.==>

<a href="#" onclick="getViewFIRDetail("8165007160050","8165007160050")">8165007160050</a>



if we are displaying modal on  getViewFIRDetail method/function, the jQuery script will not work properly. for work properly do it===>
$('#modalId').on('shown.bs.modal', function () {

`enter code here`
}

-----------------------------

but remember when you call  modal on a button by data-target, the script will work fine,
i.e.==>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>    -- on displaying modal by this method will work fine 




Comments

Popular posts from this blog

How to set custom Post feature image as og:image ?

datatable with both top and bottom scroll bar.