Ans: JSON stands for JavaScript Object Notation.
Q2. What is the definition of JSON?
Ans: It is a text-based format and designed for the exchange of data between two different systems. It is lightweight data-interchange format as compare to XML. It uses JavaScript syntax. JSON data can be read and use by any programming language.
Ans: JSON is used for communication between server side technologies and mobile app or website.
Ans: The file extension of JSON is .json.
Ans: Douglas Crockford
Ans: Douglas Crockford
Ans:
Ans: json
Ans:
Ans: There are six types of data types in JSON -
Ans:
Ans: MIME type is application/json.
Ans: For encoding, json_encode() function is used. This function takes PHP value like array as input and returns JSON representation of it. For decoding, json_decode() function is used. This function takes JSON string as input and returns associative array.
Ans: JSON.stringify() function is used to convert a JavaScript value(Object) into a JSON string.
Ans: MIME type is application/json.
Ans: For encoding, json_encode() function is used. This function takes PHP value like array as input and returns JSON representation of it. For decoding, json_decode() function is used. This function takes JSON string as input and returns associative array.
Ans: JSON.stringify() function is used to convert a JavaScript value(Object) into a JSON string.
Ans: This function is used to convert JSON string into a JavaScript object.
Ans: JSON Parser is used to parse the JSON data into object to use its value. JSON can be parse by javaScript, jQuery and PHP.
Ans: Remote Procedure call protocol with use of JSON. It is similar to XML-RPC only difference, It use JSON instead of XML.
Ans: JSON-RPC-Java is a Java implementation of the JSON-RPC protocol.
Ans: $array = array('name'=>'PHP Tutorial','Description'=>'Web technology experts notes');
echo json_encode($array);
Ans: $object='{"name":"PHP Tutorial","Description":"Expert in web technology"}'; $array = json_decode($object);
Ans: var json = '{"name":"PHP Tutorial","Description":"Web technology experts notes"}'
var obj = JSON.parse(json);
//alert(obj.name);
Ans: var obj = {}; obj['name']='php-tutorial-php.blogspot.in'; //string obj['age'] = 32; // integer. obj['marks']= [80,70,60,50,60,80]; //array
Ans: var json = '{"name":"PHP Tutorial","Description":"Web technology experts notes"}'
obj = $.parseJSON(json);
//alert(obj.name);
Ans: $json = '{"name":"PHP Tutorial","Description":"Web technology experts notes"}';
$obj = json_decode($json);
if(is_null($obj)) {
die('Invalid JSON');
}
Ans: function isValidJson(jsonData) { try { JSON.parse(jsonData); return true; } catch (e) { return false; } } var json = '{"name":"PHP Tutorial","Description":"Web technology experts notes"}' isValidJson(json);
Ans: function isValidJson(jsonData) { try { $.parseJSON(jsonData); return true; } catch (e) { return false; } } var json = '{"name":"PHP Tutorial","Description":"Web technology experts notes"}' isValidJson(json);
Ans:
$.ajax({
dataType: "json",
url: '/ajax/url',
data: 'name=php-tutorial-php',
success: function(data){
//data
}
});