I suspect your jquery is loading after the rest of the page content.
This means that you cannot reference jquery objects since the library has not yet been initialized.
Move the script page after loading jquery.
<script type="text/javascript" src="/Scripts/jquery-2.2.4.js"></script> <script> $(document).ready(function () { alert("Test"); }); </script>
For efficiency, I recommend you do this in one of two ways:
OPTION 1
Use the main script file that loads after jquery.
<script type="text/javascript" src="/Scripts/jquery-2.2.4.js"></script> <script type="text/javascript" src="/Scripts/Master.js"></script>
OPTION 2
Use a placeholder that will always load after jquery, but can be initialized on separate pages.
Master page
<script type="text/javascript" src="/Scripts/jquery-2.2.4.js"></script> <asp:ContentPlaceHolder ID="RootScripts" runat="Server"/>
Content Page
<asp:Content ID="PageScripts" ContentPlaceHolderID="RootScripts" runat="Server"> <script> $(document).ready(function () { alert("Test"); }); </script> </asp:Content>
Obsidian
source share