Home > Web Front-end > JS Tutorial > Notes on json returned by ajax using js! _javascript skills

Notes on json returned by ajax using js! _javascript skills

WBOY
Release: 2016-05-16 18:34:19
Original
886 people have browsed it
Copy code The code is as follows:

var result = unescape(xmlhttp.responseText);
var j = eval("(" result ")");

Not possible var j = eval( result );

JSON (JavaScript Object Notation) is a simple data format that is more lightweight than xml. JSON is a native JavaScript format, which means that processing JSON data in JavaScript does not require any special API or toolkit.

The rules of JSON are simple: an object is an unordered collection of "name/value pairs". An object starts with "{" (left bracket) and ends with "}" (right bracket). Each "name" is followed by a ":" (colon); "name/value" pairs are separated by a "," (comma). For specific details, please refer to http://www.json.org/json-zh.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template