다음 코드를 사용하여 나는 JS($("#deleteModal").modal("show");
에서 삭제 오류가 발생했습니다. 어떤 생각이 잘못 될 수 있습니까? 임모달 오류 - 잡히지 않은 TypeError : 정의되지 않은 함수 모달
오류가있다
MVC5 프로젝트를 사용 : 나는 같은 오류
으로 스크립트의 구걸에 실패 다음과 같이 그것을 시도 할 때 정의되지 않은 함수<!-- 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>
아니다
@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>
}
감사합니다.하지만 $ ("# deleteModal")에서 발생하지는 않습니다. 모달 ("show"); 디버거에서 디버거에서 볼 수있는 방법이 있습니다. 자세한 이유는 무엇입니까? –
예, 크롬의 개발자 도구는 좋은 방법을 제공합니다. 디버거가 예외가 발생하면 실행중인 프로세스를 중단시킬 수 있습니다. F12 키를 눌러 개발자 도구를 시작하고 소스 탭으로 전환 한 다음 사이드 바의 오른쪽 상단에서 마지막 아이콘은 wheather가 예외 상황을 벗어날 때의 동작을 설정합니다. 그런 다음 어떤 함수 호출이 실패했는지 알 수 있습니다. –
사이드 바의 오른쪽 맨 위에이 아이콘에 이름이 있습니까? 내 업데이트 된 게시물을 참조하십시오 ... –