내 mvc 응용 프로그램에서 toastr을 사용하려고합니다. 내가 Nuget에서 다운로드 할 때 나는 내 스크립트에 추가 된 두 개의 파일이 내 mvc 응용 프로그램에서 작동하도록 toastr을 가져올 수 없습니다.
toastr.js
toastr.min.js
폴더 발견 i를의 .js 내 레이아웃 페이지
<script src="~/Scripts/jquery-1.12.4.min.js"></script>
<script src="~/Scripts/toastr.js"></script>
지금 내 레이아웃 페이지에 아래의 코드를 작성에 파일 추가 스크립트 섹션. 응용 프로그램을 실행할 때 아무 일도 일어나지 않습니다. 나는 뭔가를 놓치고 있니?
$(document).ready(function() {
displayToastr();
});
function displayToastr() {
//alert('yes');
// Display a info toast, with no title
toastr.info('Hi Mahedee, This information for you.');
// Display a warning toast, with no title
toastr.warning('Hi Mahedee, This the first warning for you!');
// Display a success toast, with a title
toastr.success('Yes! You have successfully completed your task!', 'Congratulation for you, Mahedee!');
// Display an error toast, with a title
toastr.error('An error occured in the solution!', 'Please contact with system administrator.');
}
내 해결책은 다음과 같습니다. 나는 css 파일을 놓치고 있었고 내가 추가하자 모든 것이 작동하기 시작했다. – user2320476