In my MVC Web Application Im loading some scripts in the layout page, so they can be used in every other page that inherits that layout. Since I'm using stuff from Kendo and Foundation I also load their scripts as bundles.
My "head" section in the layout page looks like this:
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewBag.Title | Inquéritos Online Sublime Software</title>
<link rel="shortcut icon" href="~/Content/images/admin-favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="~/Content/css/Site.css" />
@Styles.Render("~/Content/foundation/foundation.css")
@Styles.Render("~/Content/kendo/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/foundation")
@Scripts.Render("~/bundles/kendo");
@RenderSection("head", required: false)
@* Use the Scripts section to define page specific scripts *@
@RenderSection("scripts", required: false)
<!-- Scripts -->
<script type="text/javascript" src="~/Content/scripts/scripts.js"></script>
<script type="text/javascript" src="~/Content/scripts/expand.js"></script>
<script> $(document).foundation(); </script>
</head>
As you may notice I have a semicolon after rendering the Kendo bundle. The strange thing is: If I keep that semicolon, that is not supposed to be there, all my scripts work fine, however I can see the semicolon in the page. In the other hand, if I delete that semicolon, some of my scripts just stop working. Scripts that I define in my views, p.e.
I've been looking around for some time, but I can't figure why this is happening. Any idea?
EDIT:
One of the scripts that stop working:
$('body').on('click', '.apagar', function () {
$(this).parents("div.editor-pergunta:first").remove();
return false;
});