I have a Razor view containing this script:
<script type="text/javascript">
jQuery(function()
{
alert("hello world");
})
</script>
The script doesn't open an alert Dialog when the page is loaded.
Portion of the BundleCfg:
bundles.Add(New ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.unobtrusive-ajax.js",
"~/Scripts/jquery.validate.unobtrusive.js"))
bundles.Add(New ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"))
At the End of the Layout Body:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required:=False)
(function($) { $(document).ready(function() { // Code }); })(jQuery);