I want to open bootstrap modal through jquery. I know ajax in running to success as it throws alerts. But cannot open modal. These are my code.
$.ajax({
type: "POST",
url: "<?php echo base_url() . 'index.php/application/requestCode'; ?>",
data: {
'apiName': apiName,
'api': api,
'hotel': hotel,
'payment':payment,
'template': template
},
success: function(msg)
{
$("#getCodeModal").modal("toggle");
$("#getCode").html(msg);
}
});
And my modal HTML is:
In error in console: modal is not a function.