Lasse Klüver Lasse Klüver - 1 year ago 75
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)

Answer Source

Try this

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

here is details:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download