Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.FuncName = function (variable) {
  2. $.ajax(
  3.                 {
  4.                     type: "POST",
  5.                     url: '/.../...',
  6.                     data: function(variable) {
  7.                         var obj = { field1: null, field2: null };
  8.                         if (variable) {
  9.                 obj.field1 = value1;
  10.                                 obj.field2 = value2;
  11.             } else {
  12.                 obj.field1 = value3;
  13.                                 obj.field2 = value4;
  14.             }
  15.                         JSON.stringify(obj);
  16.                     },
  17.             ...
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement