Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"jQuery ajax function template"
No comments yet. -
1 – 0 of 0
Example
$.ajax({
url: "/Home/Index",
data: { email: email, username: username, etc: etc },
success: function (data) {
debugger; // remove debugger before check-in.
$("#somelabel").text(data.SomeText);
},
type: "POST",
dataType: 'json'
});
Another example
$.ajax(
{
url: "/Account/LogOn",
type: "POST",
dataType: 'json',
data: {
username: $("txtUserName").val(),
password: $("txtPassword").val(),
rememberMe: $("#chkRememberMe").is(':checked')
},
success: function (mydata) {
if(mydata.Success) {
alert(mydata.WelcomeMessage);
}
else{
alert(mydata.Error);
}
}
});
posted by fc at
7:17 PM
on Jul 3, 2011
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"jQuery ajax function template"
No comments yet. -