[jQuery] who cann't i make it work?my first jquery aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Chat.aspx.cs"
Inherits="Chat" %>
<%@ Import Namespace="OLChatRoom" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>. . . .</title>
<link href="~/stylesheet/chatroom.css" type="text/css"
rel="stylesheet" />
my .aspx page:
</head>
<body>
<form id="form1" runat="server">
<input id="hiddenID" type="hidden" name="hiddenID"
runat="server"/>
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePartialRendering="True" EnablePageMethods="True">
</asp:ScriptManager>
<div id="status"><ul><li>the person u r chatting to is from
<asp:Label ID="country" runat="server" Text="an unknown place"></
asp:Label></li><li id="tyingStatus"></li></ul></div>
<div id="txt"><P></P></div>
<div id="Operation">
<p id="contenterea"><textarea id="txtMsg" cols="91" rows="5"></
textarea>
<div id="clickerea"><div><input id="btn" type="button" value="S E
N D"/></div><div><input id="stp" type="button" value="Stopit" /></
div></div></div>
</form>
<script src="js/room.js" type="text/javascript"></script>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></
script>
</body>
</html>
my room.js:
$(document).ready(function(){alert("myfirstjquery");})
but when i run the .aspx with IE, alert window of alert
("myfirstjquery") doesn't show up.but when i wrap $(document).ready
(function(){alert("myfirstjquery");}) in a function and invoke it in
the event "onload()" of the <body> ,it works fine.
i was told $(document).ready() is the execute after the page loaded .