Rendered source inside browser failed

不问归期 提交于 2019-12-25 12:42:13

问题


Using ASP MVC and JQuery, I am trying to show a Toast Notifaction but I got a problem with showing the rendred source inside the browser.

I used this hard coded text as example but I didn't get any notifaction:

    <script src="/template/web/js/jquery-2.2.3.min.js"></script>
@section Scripts {
    <script src="~/scripts/toastr.js"></script>
    <script src="~/scripts/toastr.min.js"></script>
    <link href="~/Content/toastr.min.css" rel="stylesheet" /> 

   <script type="text/javascript">toastr.success("Hello!");</script>
}

回答1:


It seems that you are using jQuery UI component datepicker, before jQuery and jQuery UI script are being rendered. As the result, it causes the script error, and toastr ends up not working.

So, you will need to move those jQuery, jQuery UI and toastr scripts inside head tag.



来源:https://stackoverflow.com/questions/47576977/rendered-source-inside-browser-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!