Advertisement
loonerz

function

Jan 15th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function () {
  2.     $('#formNew').submit(function () {
  3.         var datos = {
  4.             "Nombre": $('#nombre').val(),
  5.             "ApellidoP": $('#appP').val(),
  6.             "ApellidoM": $('#appM').val(),
  7.             "UserName": $('#username').val(),
  8.             "Password": $('#password').val(),
  9.         };
  10.         var args = "Data=" + JSON.stringify(datos);
  11.         var url = 'http://127.0.0.1:81/SismosService.svc/usuario/new';
  12.  
  13.         alert(url);
  14.         $.ajax({
  15.             type: 'POST',
  16.             url: url,
  17.             data: args,
  18.             contentType: 'application/json; charset=utf-8',
  19.             success: function (data) {
  20.                 alert("Exito " + JSON.parse(data));
  21.             },
  22.             error: function (data) {
  23.                 alert("Error " + JSON.parse(data));
  24.             }
  25.         });
  26.     });
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement