Lasse Klüver Lasse Klüver - 5 months ago 41
HTML Question

ASP.NET MVC jQuery document ready function not called

I have a Razor view containing this script:

<script type="text/javascript">
alert("hello world");

The script dosent open an alert Dialog when the page is loaded.

Portion of the BundleCfg:

bundles.Add(New ScriptBundle("~/bundles/jquery").Include(

bundles.Add(New ScriptBundle("~/bundles/jqueryval").Include(

At the End of the Layout Body:

@RenderSection("scripts", required:=False)


Try this

$(document).ready(function() {
    alert("hello world");

here is details: