使用「基本」模板我會從視圖中刪除jquery腳本標記。當我創建在VS2012新MVC4項目_Layout.cshtml看起來像這樣
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
線@ Scripts.Render(「〜/包/ jQuery的」)會將jQuery腳本標籤視圖後體內。您可以更改您的視圖,以便它呈現fullcalender.js和文檔準備功能的jQuery腳本標籤這樣
@{
ViewBag.Title = "Index";
}
@section scripts {
<link href="@Url.Content("~/Scripts/fullcalendar.css")"rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/fullcalendar.js")" type="text/javascript"></script>
<script type ='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({});
});
</script>
}
<h2>Index</h2>
<div id='calendar'></div>
謝謝我在佈局中的信息,所以我用代碼替換了視圖,但仍然沒有日曆。我會繼續嘗試看看我能否修正這個問題。 – bmorrison1982
你是否收到任何錯誤訊息? – 2012-12-04 22:45:36
沒有錯誤它是在導致問題的佈局telrik – bmorrison1982