Im using the following code and I got error in delete in the JS($("#deleteModal").modal("show");),any idea what can be wrong here ? Im using MVC5 project
the error is
Uncaught TypeError: undefined is not a function
<!-- Modal --> <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> <h4 class="modal-title" id="deleteModalLabel">Delete Item</h4> </div> <div id="deleteModalBody" class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <script> $(function () { $("#deleteModal").modal("hide"); // initially hides the modal pop-up until needed $(".deleteLink").on("click", function () { $.get('@Url.Action("GetDeletePartial")', { id: $(this).prop("id") }, function (data) { $("#deleteModalBody").html(data); $("#deleteModal").modal("show"); // shows the modal pop-up now that we have our partial view }); }); }); </script> when I try it like following it fail in the begging of the script with the same error
@section scripts { <script src="~/Scripts/jquery-2.1.1.min.js"></script> <script> $(function () { $("#deleteModal").modal("hide"); // initially hides the modal pop-up until needed $(".deleteLink").on("click", function () { $.get('@Url.Action("GetDeletePartial")', { id: $(this).prop("id") }, function (data) { $("#deleteModalBody").html(data); $("#deleteModal").modal("show"); // shows the modal pop-up now that we have our partial view }); }); }); </script> }