Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does .d in JSON mean?

I have a .NET webmethod that I have called from jQuery. The method returns some HTML markup that I display within a DIV element.

Once I have the response I use

$("#div").html(result.d); 

My question is, what does the .d do? I don't like using code I don't fully understand? Could I get the same result using Eval?

like image 598
Fermin Avatar asked May 06 '09 15:05

Fermin


People also ask

Why are there backslashes in JSON?

Those backslashes are escape characters. They are escaping the special characters inside of the string associated with JSON response. You have to use JSON. parse to parse that JSON string into a JSON object.

How do I fix JSON format?

JSON Syntax RulesData is in name/value pairs. Data is separated by commas. Curly braces hold objects. Square brackets hold arrays.

What is a JsonResult?

What is JsonResult ? JsonResult is one of the type of MVC action result type which returns the data back to the view or the browser in the form of JSON (JavaScript Object notation format). In this article we will learn about JsonResult by taking scenario to bind view using the JSON Data .

What is the correct format of writing JSON name value pair?

Data is represented in name/value pairs. Curly braces hold objects and each name is followed by ':'(colon), the name/value pairs are separated by , (comma). Square brackets hold arrays and values are separated by ,(comma).


1 Answers

Are you referring to the ADO.NET Data Services?

I remember hearing a presentation about the JSON returning this and I think its just a wrapper to ensure the payload is a JSON object as opposed to an array (which is the case of returning multiple entities).

Why 'd' specifically? I think I remember them saying something like 'well it had to be something'.

like image 71
Clinton Avatar answered Oct 09 '22 06:10

Clinton