Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$(document).ready not Working

I am trying to run jQuery and WebMethods with ASP.NET; I have added a ScriptManager to the master page, and a content on the content page

<asp:Content ID="ch" ContentPlaceHolderID="cHead" runat="server">     <script language="javascript" type="text/javascript">        $(document).ready(function () {           alert("hi");        });     </script> </asp:Content> 

However this never fires, what am I missing?

like image 410
paul simmons Avatar asked May 22 '11 04:05

paul simmons


People also ask

Is not a function $( document .ready function ()?

ready is not a function" error occurs for multiple reasons: Placing second set of parenthesis after the call to the ready() method. Loading the jQuery library after running your JavaScript code. Forgetting to load the jQuery library.

What does $( document .ready function () mean?

$( document ). ready()A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside $( document ). ready() will only run once the page Document Object Model (DOM) is ready for JavaScript code to execute.

What is replacement of $( document .ready function?

load(function(){ // ...}) @undefined, this is almost the same as $(document). ready(function(){ ... }) . load() will wait until the graphics are also loaded.

What is $( document .ready () and $( window .load () in jQuery?

ready() and $(window). load() event is that the code included inside onload function will run once the entire page(images, iframes, stylesheets,etc) are loaded whereas the $(document). ready() event fires before all images,iframes etc. are loaded, but after the whole DOM itself is ready.


1 Answers

Verify the following steps.

  1. Did you include jquery
  2. Check for errors in firebug

Those things should fix the problem

like image 67
kobe Avatar answered Sep 20 '22 06:09

kobe