views:

165

answers:

1

I am writing jquery ajax code to call wcf service.

In this case WCf returns html as string.

Some how when data is back in jquery it is in {d:"data"} format, What is this d element?

below is code

$.get('<%= ResolveClientUrl("~/AjaxServices/ListingBrowse.svc/GetNewsHTML") %> ', null, function(data) { alert(data); $('#newsdiv').html(data.d); }, "html");

+3  A: 

The extra "d" parameter is added by the .NET framework as an added security measure against XSS attacks (source). It's included when the "Content-Type" of the request specifies "application/json".

Crescent Fresh
Thanks for answer, i changed datatype to json and no more d element
mamu