我的项目在 MVC 4 中。当重新加载页面时,我的脚本在 _Layout.cshtml 中,出现以下错误:JScript 运行时错误:'$' is undefined
_Layout.cshtml:
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="~/Images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
<script type="text/javascript" src="~/Scripts/jquery.qtip-1.0.0-rc3.min.js"> </script>
</head>
我的部分观点:
<script type="text/javascript">
$('#lnkOrganizar').click(function () {
if (($('.frozenTopC').css('display') != 'none') && ($('.frozenTopConteudo').css('display') != 'none')) {
$('.frozenTopC').css('display', 'none');
$('.frozenTopConteudo').css('display', 'none');
}
else {
$('.frozenTopC').css('display', 'table-cell');
$('.frozenTopConteudo').css('display', 'table-cell')
}
});
</script>