JQuery.ajax(): Problem with parameter data when consuming a WCF Service

Posted by Torben H. on Stack Overflow See other posts from Stack Overflow or by Torben H.
Published on 2011-01-13T09:35:25Z Indexed on 2011/01/13 9:54 UTC
Read the original article Hit count: 212

Filed under:
|

Hello,

I'm using JQuery to consume a WCF Service. Actually this works fine:

var para = ' { "Parameter" : { "ID" : "5", "Name" : "Peter" } }'
$.ajax({
   type: "POST",
   contentType: "application/json",
   data: para,
   url: url
   success: success
});

But I don't want to pass the data parameter as String and I think it should be possible to pass ist as array in any way. Like that:

var para = { "Parameter" : { "ID" : 5, "Name" : "Peter" } }

But when I try this I'm getting an error. What I'm doing wrong?

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about wcf