Hi,
I am using Asp.Net 2.0.I am trying to learn webservice and call that webservice using jquery ajax method
The problem is jquery ajax is not working properly and i could not find out where i have gone wrong.
Here's my jquery code
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#Button1").click(function(){
$.ajax({
type:"POST",
url:"/WebService.asmx/GetDateTime",
data:"{}",
contentType:"application/json; charset=utf-8",
dataType:"json",
succss: function(msg){
alert("Success");
},
failure:function(response){
alert("Error");
}
});
});
});
</script>
Heres my webservice
[WebMethod]
public string GetDateTime()
{
return DateTime.Now.ToString();
}