浏览器内部的渲染源失败

浏览器内部的渲染源失败

本文介绍了浏览器内部的渲染源失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP MVC和JQuery尝试显示Toast Notifaction,但在浏览器中显示更新的源时遇到了问题.

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>
}

推荐答案

在呈现jQueryjQuery UI脚本之前,您似乎正在使用jQuery UI组件datepicker.结果,它导致脚本错误,并且toastr最终不起作用.

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.

因此,您需要将这些jQueryjQuery UItoastr脚本移动到 head 标记内.

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

这篇关于浏览器内部的渲染源失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 23:09