Link to home
Start Free TrialLog in
Avatar of websss
websssFlag for Kenya

asked on

javascript alert not firing in layout.cshtml

I have a layout.cshtml page

I'm trying to get a simple alert('hi'); to fire, but none of the alerts below are firing

 @section scripts{
        <script type="text/javascript">
               alert('hi');
            $(document).ready(function () {

                alert('layout');
               
            });

        </script>
    }

  @RenderBody()


    <!-- PAGE FOOTER -->
    <div class="page-footer">
        <div class="row">
            <div class="col-xs-12 col-sm-6">
                <span class="txt-color-white">@ViewBag.Footer</span>
            </div>

        </div>
    </div>


  @RenderSection("scripts", required: false)

Open in new window



Is there some special order i have to follow to get this working?
SOLUTION
Avatar of PANkaj Kumar
PANkaj Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of websss

ASKER

thanks both, got it working