Calling the page method with jQuery

Calling the page method with jQuery

Hey All,

I am in the middle of a project. i want to call the page methods with j query
instead using script manager.Im very new to this whole jquery thing,and i was hoping that someone could give me a hand.

Thanks Inadvance..
Shiva.

Here is is my code........

Creating a page method for testing purposes.
public partial class _Default : Page
{
[WebMethod]
public static string GetDate()
{
return DateTime.Now.ToString();
}
}

Calling the page method with jQuery instead.
As you can see, there’s no ScriptManager required, much less EnablePageMethods.

As referenced in Default.aspx, this is Default.js:

$(document).ready(function() {
// Add the page method call as an onclick handler for the div.
$("#Result").click(function() {
$.ajax({
type: "POST",
url: "Default.aspx/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Replace the div's content with the page method's return.
$("#Result").text(msg.d);
}
});
});
});

<html>
<head>
<title>Calling a page method with jQuery</title>
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="Default.js"></script>
</head>
<body>
<div id="Result">Click here for the time.</div>
</body>
</html>

This is not working Please Help me out.......