में बूटस्ट्रैप मोडल को कैसे खोलें I jquery के माध्यम से बूटस्ट्रैप मोडल खोलना चाहते हैं। मैं सफलता के लिए दौड़ने में AJAX जानता हूं क्योंकि यह अलर्ट फेंकता है। लेकिन मोडल नहीं खोल सकते हैं। ये मेरे कोड हैं।AJAX सफलता
$.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);
}
});
और मेरे मोडल HTML है:
<!-- Modal -->
<div class="modal fade" id="getCodeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"> API CODE </h4>
</div>
<div class="modal-body" id="getCode" style="overflow-x: scroll;">
//ajax success content here.
</div>
</div>
</div>
</div>
कंसोल में त्रुटि में: मोडल एक समारोह नहीं है।
और क्या होता है? कंसोल में कुछ त्रुटियां? –
'सफलता' के साथ एक पंक्ति में उद्घाटन ब्रैकेट डालने का प्रयास करें: फ़ंक्शन (msg) '' – knitevision
क्या आपने 'bootstrap.js' आयात किया था? –