x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

x
x
x
Hire a Tutor

Answers and Solutions

What's Your Question?
Answer

Type of notaion easy to read

Answer
JSON in general is a type of notation which is easy to read and understand, for example lets say you want to store a student data with fields name, age and class then in json you can store it in below format: student{ "name": " Aniket", "age":"15", "class":"10" } I hope you understand json now. So you can use json to achieve your requirement using ajax too. :)
Answer

Javascript Objject Notation

Answer

$("button").click(function(){     $.getJSON("demo_ajax_json.js", function(result){         $.each(result, function(i, field){             $("div").append(field + " ");         });     }); });

 

  • Retrieve the file as plain text using "response.responseText", then use eval() on it to turn the JSON valid text file into a JavaScript object.
  • Notice how a parenthesis surrounds the statement to evalulate so it's actually "(response.responseText)" This is necessary to turn the statement into an expression, so eval() can evaluate it instead of JavaScript executing the statement instead.
  • The result is a custom JavaScript object, with which you access its various properties using the standard "dot" notation.

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer