json strings code example
Example 1: json object
var myObj, x;
myObj = {"name":"John", "age":30, "car":null};
x = myObj.name;
document.getElementById("demo").innerHTML = x;
Example 2: correct json type
For JSON text:
application/json
The MIME media type for JSON text is application/json.
The default encoding is UTF-8. (Source: RFC 4627).
For JSONP (runnable javascript) with callback:
application/javascript