Deepak Awashti

Deepak Awashti

  • NA
  • 301
  • 74.2k

Explain Full Code

Dec 7 2015 5:11 AM
$(function () {
$("#btnSave").bind("click", function () {
var Name;
Name = $("#txtname").val();
var Age = $("#txtage").val();
var Address = $("#txtaddress").val();
var Email_id = $("#txtemail").val();
var Pswd = $("#txtpswd").val();
$.ajax({
type: "POST",
url: "Default.aspx/SaveUser",
data: "{Name: ' " + Name + " ',Age:'" + Age + "',Address:'" + Address + "',Email_id:'" + Email_id + "',Pswd:'" + Pswd + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data)
{
var obj = data.d;
if (obj == 'Save')
{
var str = "<tr><td>" + Name + "</td><td>" + Age + "</td><td>" + Address + "</td><td>" + Email_id + "</td><td>" + Pswd + "</td></tr>";
$('#tb1').append(str);
}
alert("User has been added successfully.");
//window.location.reload();
}
});
return false;
 
 
pls xplain in all line  , why are used in all linesin jquery 

Answers (2)