|
0
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
|
2 |
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#"> |
|
|
3 |
<head> |
|
|
4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
|
5 |
<title>API: json JSON (YUI Library)</title> |
|
|
6 |
|
|
|
7 |
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" /> |
|
|
8 |
<link rel="stylesheet" type="text/css" href="assets/api.css" /> |
|
|
9 |
|
|
|
10 |
<script type="text/javascript" src="assets/api-js"></script> |
|
|
11 |
<script type="text/javascript" src="assets/ac-js"></script> |
|
|
12 |
</head> |
|
|
13 |
|
|
|
14 |
<body id="yahoo-com"> |
|
|
15 |
|
|
|
16 |
<div id="doc3" class="yui-t2"> |
|
|
17 |
<div id="hd"> |
|
|
18 |
<h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1> |
|
|
19 |
<h3>json <span class="subtitle">3.0.0</span></h3> |
|
|
20 |
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> |
|
|
21 |
> <a href="./module_json.html" title="json">json</a> |
|
|
22 |
> JSON |
|
|
23 |
|
|
|
24 |
<form onsubmit="return false"> |
|
|
25 |
<div id="propertysearch"> |
|
|
26 |
Search: <input autocomplete="off" id="searchinput" /> |
|
|
27 |
<div id="searchresults"> |
|
|
28 |
|
|
|
29 |
</div> |
|
|
30 |
</div> |
|
|
31 |
</form> |
|
|
32 |
</div> |
|
|
33 |
|
|
|
34 |
<div id="bd"> |
|
|
35 |
<div id="yui-main"> |
|
|
36 |
<div class="yui-b"> |
|
|
37 |
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form"> |
|
|
38 |
<fieldset> |
|
|
39 |
<legend>Filters</legend> |
|
|
40 |
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span> |
|
|
41 |
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span> |
|
|
42 |
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span> |
|
|
43 |
</fieldset> |
|
|
44 |
</form> |
|
|
45 |
|
|
|
46 |
<h2> |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
<code>static</code> |
|
|
50 |
|
|
|
51 |
Class <b property="yui:name">JSON</b> |
|
|
52 |
<span class="extends"> |
|
|
53 |
</span> |
|
|
54 |
|
|
|
55 |
</h2> |
|
|
56 |
<!-- class tree goes here --> |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
<div class="summary description" property="yui:description"> |
|
|
62 |
<p>The JSON module adds support for serializing JavaScript objects into |
|
|
63 |
JSON strings and parsing JavaScript objects from strings in JSON format.</p> |
|
|
64 |
<p>The JSON namespace is added to your YUI instance including static methods |
|
|
65 |
Y.JSON.parse(..) and Y.JSON.stringify(..).</p> |
|
|
66 |
<p>The functionality and method signatures follow the ECMAScript 5 |
|
|
67 |
specification. In browsers with native JSON support, the native |
|
|
68 |
implementation is used.</p> |
|
|
69 |
<p>The <code>json</code> module is a rollup of <code>json-parse</code> and |
|
|
70 |
<code>json-stringify</code>.</p> |
|
|
71 |
<p>As their names suggest, <code>json-parse</code> adds support for parsing |
|
|
72 |
JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing |
|
|
73 |
JavaScript data into JSON strings (Y.JSON.stringify). You may choose to |
|
|
74 |
include either of the submodules individually if you don't need the |
|
|
75 |
complementary functionality, or include the rollup for both.</p> |
|
|
76 |
</div> |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
<div rel="yui:properties" resource="#properties"> |
|
|
80 |
<div class="section field details"> |
|
|
81 |
<h3 id="properties">Properties</h3> |
|
|
82 |
<div class="content"> |
|
|
83 |
<div class="private" rel="yui:property" resource="#property__BRACKETS"> |
|
|
84 |
<h4><a name="property__BRACKETS" property="yui:name">_BRACKETS</a> |
|
|
85 |
- <code>private <span property="yui:type">{RegExp}</span></code> |
|
|
86 |
</h4> |
|
|
87 |
<div class="detail"> |
|
|
88 |
<div class="description" property="yui:description"> |
|
|
89 |
Third step in the safety evaluation. Regex used to remove all open |
|
|
90 |
square brackets following a colon, comma, or at the beginning of the |
|
|
91 |
string. |
|
|
92 |
</div> |
|
|
93 |
</div> |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
<hr /> |
|
|
99 |
</div> |
|
|
100 |
<div class="private" rel="yui:property" resource="#property__ESCAPES"> |
|
|
101 |
<h4><a name="property__ESCAPES" property="yui:name">_ESCAPES</a> |
|
|
102 |
- <code>private <span property="yui:type">{RegExp}</span></code> |
|
|
103 |
</h4> |
|
|
104 |
<div class="detail"> |
|
|
105 |
<div class="description" property="yui:description"> |
|
|
106 |
First step in the safety evaluation. Regex used to replace all escape |
|
|
107 |
sequences (i.e. "\\", etc) with '@' characters (a non-JSON character). |
|
|
108 |
</div> |
|
|
109 |
</div> |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
|
|
|
114 |
<hr /> |
|
|
115 |
</div> |
|
|
116 |
<div class="private" rel="yui:property" resource="#property__UNICODE_EXCEPTIONS"> |
|
|
117 |
<h4><a name="property__UNICODE_EXCEPTIONS" property="yui:name">_UNICODE_EXCEPTIONS</a> |
|
|
118 |
- <code>private <span property="yui:type">{RegExp}</span></code> |
|
|
119 |
</h4> |
|
|
120 |
<div class="detail"> |
|
|
121 |
<div class="description" property="yui:description"> |
|
|
122 |
Replace certain Unicode characters that JavaScript may handle incorrectly |
|
|
123 |
during eval--either by deleting them or treating them as line |
|
|
124 |
endings--with escape sequences. |
|
|
125 |
IMPORTANT NOTE: This regex will be used to modify the input if a match is |
|
|
126 |
found. |
|
|
127 |
</div> |
|
|
128 |
</div> |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
<hr /> |
|
|
134 |
</div> |
|
|
135 |
<div class="private" rel="yui:property" resource="#property__UNSAFE"> |
|
|
136 |
<h4><a name="property__UNSAFE" property="yui:name">_UNSAFE</a> |
|
|
137 |
- <code>private <span property="yui:type">{RegExp}</span></code> |
|
|
138 |
</h4> |
|
|
139 |
<div class="detail"> |
|
|
140 |
<div class="description" property="yui:description"> |
|
|
141 |
Final step in the safety evaluation. Regex used to test the string left |
|
|
142 |
after all previous replacements for invalid characters. |
|
|
143 |
</div> |
|
|
144 |
</div> |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
<hr /> |
|
|
150 |
</div> |
|
|
151 |
<div class="private" rel="yui:property" resource="#property__VALUES"> |
|
|
152 |
<h4><a name="property__VALUES" property="yui:name">_VALUES</a> |
|
|
153 |
- <code>private <span property="yui:type">{RegExp}</span></code> |
|
|
154 |
</h4> |
|
|
155 |
<div class="detail"> |
|
|
156 |
<div class="description" property="yui:description"> |
|
|
157 |
Second step in the safety evaluation. Regex used to replace all simple |
|
|
158 |
values with ']' characters. |
|
|
159 |
</div> |
|
|
160 |
</div> |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
<hr /> |
|
|
166 |
</div> |
|
|
167 |
<div class="" rel="yui:property" resource="#property_JSON.useNativeStringify"> |
|
|
168 |
<h4><a name="property_JSON.useNativeStringify" property="yui:name">JSON.useNativeStringify</a> |
|
|
169 |
- <code>static <span property="yui:type">Boolean</span></code> |
|
|
170 |
</h4> |
|
|
171 |
<div class="detail"> |
|
|
172 |
<div class="description" property="yui:description"> |
|
|
173 |
Leverage native JSON stringify if the browser has a native |
|
|
174 |
implementation. In general, this is a good idea. See the Known Issues |
|
|
175 |
section in the JSON user guide for caveats. The default value is true |
|
|
176 |
for browsers with native JSON support. |
|
|
177 |
</div> |
|
|
178 |
</div> |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
<div class="default" property="yui:defaultValue"> |
|
|
182 |
Default Value: true |
|
|
183 |
</div> |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
<hr /> |
|
|
187 |
</div> |
|
|
188 |
<div class="private" rel="yui:property" resource="#property_Native"> |
|
|
189 |
<h4><a name="property_Native" property="yui:name">Native</a> |
|
|
190 |
- <code>private <span property="yui:type">{Object}</span></code> |
|
|
191 |
</h4> |
|
|
192 |
<div class="detail"> |
|
|
193 |
<div class="description" property="yui:description"> |
|
|
194 |
Alias to native browser implementation of the JSON object if available. |
|
|
195 |
</div> |
|
|
196 |
</div> |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
|
201 |
<hr /> |
|
|
202 |
</div> |
|
|
203 |
<div class="" rel="yui:property" resource="#property_useNativeParse"> |
|
|
204 |
<h4><a name="property_useNativeParse" property="yui:name">useNativeParse</a> |
|
|
205 |
- <code>static <span property="yui:type">Boolean</span></code> |
|
|
206 |
</h4> |
|
|
207 |
<div class="detail"> |
|
|
208 |
<div class="description" property="yui:description"> |
|
|
209 |
Leverage native JSON parse if the browser has a native implementation. |
|
|
210 |
In general, this is a good idea. See the Known Issues section in the |
|
|
211 |
JSON user guide for caveats. The default value is true for browsers with |
|
|
212 |
native JSON support. |
|
|
213 |
</div> |
|
|
214 |
</div> |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
<div class="default" property="yui:defaultValue"> |
|
|
218 |
Default Value: true |
|
|
219 |
</div> |
|
|
220 |
|
|
|
221 |
|
|
|
222 |
<hr /> |
|
|
223 |
</div> |
|
|
224 |
</div> |
|
|
225 |
</div> |
|
|
226 |
|
|
|
227 |
</div> |
|
|
228 |
|
|
|
229 |
<div rel="yui:methods" resource="#methods"> |
|
|
230 |
<div class="section method details"> |
|
|
231 |
<h3 id="methods">Methods</h3> |
|
|
232 |
<div class="content"> |
|
|
233 |
<div class="private" rel="yui:method" resource="#method__revive"> |
|
|
234 |
<h4> |
|
|
235 |
<a name="method__revive">_revive</a></h4> |
|
|
236 |
<div class="detail" > |
|
|
237 |
<code> |
|
|
238 |
private |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
MIXED |
|
|
242 |
<strong property="yui:name">_revive</strong> |
|
|
243 |
( |
|
|
244 |
|
|
|
245 |
|
|
|
246 |
data |
|
|
247 |
|
|
|
248 |
|
|
|
249 |
, |
|
|
250 |
reviver |
|
|
251 |
|
|
|
252 |
|
|
|
253 |
) |
|
|
254 |
</code> |
|
|
255 |
|
|
|
256 |
<div class="description" property="yui:description"> |
|
|
257 |
Traverses nested objects, applying a reviver function to each (key,value) |
|
|
258 |
from the scope if the key:value's containing object. The value returned |
|
|
259 |
from the function will replace the original value in the key:value pair. |
|
|
260 |
If the value returned is undefined, the key will be omitted from the |
|
|
261 |
returned object. |
|
|
262 |
</div> |
|
|
263 |
|
|
|
264 |
<div class="description"> |
|
|
265 |
|
|
|
266 |
<dl rel="yui:parameters"> |
|
|
267 |
<dt>Parameters:</dt> |
|
|
268 |
<dd rel="yui:parameter"> |
|
|
269 |
<code><span property="yui:name">data</span> |
|
|
270 |
<<span property="yui:type">MIXED</span>> |
|
|
271 |
</code> |
|
|
272 |
<span property="yui:description"> Any JavaScript data</span> |
|
|
273 |
</dd> |
|
|
274 |
<dd rel="yui:parameter"> |
|
|
275 |
<code><span property="yui:name">reviver</span> |
|
|
276 |
<<span property="yui:type">Function</span>> |
|
|
277 |
</code> |
|
|
278 |
<span property="yui:description"> filter or mutation function</span> |
|
|
279 |
</dd> |
|
|
280 |
</dl> |
|
|
281 |
|
|
|
282 |
<dl> |
|
|
283 |
<dt>Returns: |
|
|
284 |
<code property="yui:return"> |
|
|
285 |
MIXED |
|
|
286 |
</code></dt> |
|
|
287 |
<dd property="yui:returnInfo">The results of the filtered data</dd> |
|
|
288 |
</dl> |
|
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
|
293 |
</div> |
|
|
294 |
|
|
|
295 |
</div> |
|
|
296 |
<hr /> |
|
|
297 |
</div> |
|
|
298 |
<div class="" rel="yui:method" resource="#method_dateToString"> |
|
|
299 |
<h4> |
|
|
300 |
<a name="method_dateToString">dateToString</a></h4> |
|
|
301 |
<div class="detail" > |
|
|
302 |
<code> |
|
|
303 |
|
|
|
304 |
static |
|
|
305 |
|
|
|
306 |
String |
|
|
307 |
<strong property="yui:name">dateToString</strong> |
|
|
308 |
( |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
d |
|
|
312 |
|
|
|
313 |
|
|
|
314 |
) |
|
|
315 |
</code> |
|
|
316 |
|
|
|
317 |
<div class="description" property="yui:description"> |
|
|
318 |
Serializes a Date instance as a UTC date string. Used internally by |
|
|
319 |
stringify. Override this method if you need Dates serialized in a |
|
|
320 |
different format. |
|
|
321 |
</div> |
|
|
322 |
|
|
|
323 |
<div class="description"> |
|
|
324 |
|
|
|
325 |
<dl rel="yui:parameters"> |
|
|
326 |
<dt>Parameters:</dt> |
|
|
327 |
<dd rel="yui:parameter"> |
|
|
328 |
<code><span property="yui:name">d</span> |
|
|
329 |
<<span property="yui:type">Date</span>> |
|
|
330 |
</code> |
|
|
331 |
<span property="yui:description"> The Date to serialize</span> |
|
|
332 |
</dd> |
|
|
333 |
</dl> |
|
|
334 |
|
|
|
335 |
<dl> |
|
|
336 |
<dt>Returns: |
|
|
337 |
<code property="yui:return"> |
|
|
338 |
String |
|
|
339 |
</code></dt> |
|
|
340 |
<dd property="yui:returnInfo">stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ</dd> |
|
|
341 |
</dl> |
|
|
342 |
|
|
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
|
346 |
</div> |
|
|
347 |
|
|
|
348 |
</div> |
|
|
349 |
<hr /> |
|
|
350 |
</div> |
|
|
351 |
<div class="private" rel="yui:method" resource="#method_escapeException"> |
|
|
352 |
<h4> |
|
|
353 |
<a name="method_escapeException">escapeException</a></h4> |
|
|
354 |
<div class="detail" > |
|
|
355 |
<code> |
|
|
356 |
private |
|
|
357 |
|
|
|
358 |
|
|
|
359 |
String |
|
|
360 |
<strong property="yui:name">escapeException</strong> |
|
|
361 |
( |
|
|
362 |
|
|
|
363 |
|
|
|
364 |
c |
|
|
365 |
|
|
|
366 |
|
|
|
367 |
) |
|
|
368 |
</code> |
|
|
369 |
|
|
|
370 |
<div class="description" property="yui:description"> |
|
|
371 |
Replaces specific unicode characters with their appropriate \unnnn |
|
|
372 |
format. Some browsers ignore certain characters during eval. |
|
|
373 |
</div> |
|
|
374 |
|
|
|
375 |
<div class="description"> |
|
|
376 |
|
|
|
377 |
<dl rel="yui:parameters"> |
|
|
378 |
<dt>Parameters:</dt> |
|
|
379 |
<dd rel="yui:parameter"> |
|
|
380 |
<code><span property="yui:name">c</span> |
|
|
381 |
<<span property="yui:type">String</span>> |
|
|
382 |
</code> |
|
|
383 |
<span property="yui:description"> Unicode character</span> |
|
|
384 |
</dd> |
|
|
385 |
</dl> |
|
|
386 |
|
|
|
387 |
<dl> |
|
|
388 |
<dt>Returns: |
|
|
389 |
<code property="yui:return"> |
|
|
390 |
String |
|
|
391 |
</code></dt> |
|
|
392 |
<dd property="yui:returnInfo">the \unnnn escapement of the character</dd> |
|
|
393 |
</dl> |
|
|
394 |
|
|
|
395 |
|
|
|
396 |
|
|
|
397 |
|
|
|
398 |
</div> |
|
|
399 |
|
|
|
400 |
</div> |
|
|
401 |
<hr /> |
|
|
402 |
</div> |
|
|
403 |
<div class="" rel="yui:method" resource="#method_parse"> |
|
|
404 |
<h4> |
|
|
405 |
<a name="method_parse">parse</a></h4> |
|
|
406 |
<div class="detail" > |
|
|
407 |
<code> |
|
|
408 |
|
|
|
409 |
static |
|
|
410 |
|
|
|
411 |
MIXED |
|
|
412 |
<strong property="yui:name">parse</strong> |
|
|
413 |
( |
|
|
414 |
|
|
|
415 |
|
|
|
416 |
s |
|
|
417 |
|
|
|
418 |
|
|
|
419 |
, |
|
|
420 |
reviver |
|
|
421 |
|
|
|
422 |
|
|
|
423 |
) |
|
|
424 |
</code> |
|
|
425 |
|
|
|
426 |
<div class="description" property="yui:description"> |
|
|
427 |
Parse a JSON string, returning the native JavaScript representation. |
|
|
428 |
</div> |
|
|
429 |
|
|
|
430 |
<div class="description"> |
|
|
431 |
|
|
|
432 |
<dl rel="yui:parameters"> |
|
|
433 |
<dt>Parameters:</dt> |
|
|
434 |
<dd rel="yui:parameter"> |
|
|
435 |
<code><span property="yui:name">s</span> |
|
|
436 |
<<span property="yui:type">string</span>> |
|
|
437 |
</code> |
|
|
438 |
<span property="yui:description"> JSON string data</span> |
|
|
439 |
</dd> |
|
|
440 |
<dd rel="yui:parameter"> |
|
|
441 |
<code><span property="yui:name">reviver</span> |
|
|
442 |
<<span property="yui:type">function</span>> |
|
|
443 |
</code> |
|
|
444 |
<span property="yui:description"> (optional) function(k,v) passed each key value |
|
|
445 |
pair of object literals, allowing pruning or altering values</span> |
|
|
446 |
</dd> |
|
|
447 |
</dl> |
|
|
448 |
|
|
|
449 |
<dl> |
|
|
450 |
<dt>Returns: |
|
|
451 |
<code property="yui:return"> |
|
|
452 |
MIXED |
|
|
453 |
</code></dt> |
|
|
454 |
<dd property="yui:returnInfo">the native JavaScript representation of the JSON string</dd> |
|
|
455 |
</dl> |
|
|
456 |
|
|
|
457 |
|
|
|
458 |
|
|
|
459 |
|
|
|
460 |
</div> |
|
|
461 |
|
|
|
462 |
</div> |
|
|
463 |
<hr /> |
|
|
464 |
</div> |
|
|
465 |
<div class="" rel="yui:method" resource="#method_stringify"> |
|
|
466 |
<h4> |
|
|
467 |
<a name="method_stringify">stringify</a></h4> |
|
|
468 |
<div class="detail" > |
|
|
469 |
<code> |
|
|
470 |
|
|
|
471 |
static |
|
|
472 |
|
|
|
473 |
string |
|
|
474 |
<strong property="yui:name">stringify</strong> |
|
|
475 |
( |
|
|
476 |
|
|
|
477 |
|
|
|
478 |
o |
|
|
479 |
|
|
|
480 |
|
|
|
481 |
, |
|
|
482 |
w |
|
|
483 |
|
|
|
484 |
|
|
|
485 |
, |
|
|
486 |
ind |
|
|
487 |
|
|
|
488 |
|
|
|
489 |
) |
|
|
490 |
</code> |
|
|
491 |
|
|
|
492 |
<div class="description" property="yui:description"> |
|
|
493 |
<p>Converts an arbitrary value to a JSON string representation.</p> |
|
|
494 |
<p>Objects with cyclical references will trigger an exception.</p> |
|
|
495 |
<p>If a whitelist is provided, only matching object keys will be |
|
|
496 |
included. Alternately, a replacer function may be passed as the |
|
|
497 |
second parameter. This function is executed on every value in the |
|
|
498 |
input, and its return value will be used in place of the original value. |
|
|
499 |
This is useful to serialize specialized objects or class instances.</p> |
|
|
500 |
<p>If a positive integer or non-empty string is passed as the third |
|
|
501 |
parameter, the output will be formatted with carriage returns and |
|
|
502 |
indentation for readability. If a String is passed (such as "\t") it |
|
|
503 |
will be used once for each indentation level. If a number is passed, |
|
|
504 |
that number of spaces will be used.</p> |
|
|
505 |
</div> |
|
|
506 |
|
|
|
507 |
<div class="description"> |
|
|
508 |
|
|
|
509 |
<dl rel="yui:parameters"> |
|
|
510 |
<dt>Parameters:</dt> |
|
|
511 |
<dd rel="yui:parameter"> |
|
|
512 |
<code><span property="yui:name">o</span> |
|
|
513 |
<<span property="yui:type">MIXED</span>> |
|
|
514 |
</code> |
|
|
515 |
<span property="yui:description"> any arbitrary value to convert to JSON string</span> |
|
|
516 |
</dd> |
|
|
517 |
<dd rel="yui:parameter"> |
|
|
518 |
<code><span property="yui:name">w</span> |
|
|
519 |
<<span property="yui:type">Array|Function</span>> |
|
|
520 |
</code> |
|
|
521 |
<span property="yui:description"> (optional) whitelist of acceptable object |
|
|
522 |
keys to include, or a replacer function to modify the |
|
|
523 |
raw value before serialization</span> |
|
|
524 |
</dd> |
|
|
525 |
<dd rel="yui:parameter"> |
|
|
526 |
<code><span property="yui:name">ind</span> |
|
|
527 |
<<span property="yui:type">Number|String</span>> |
|
|
528 |
</code> |
|
|
529 |
<span property="yui:description"> (optional) indentation character or depth of |
|
|
530 |
spaces to format the output.</span> |
|
|
531 |
</dd> |
|
|
532 |
</dl> |
|
|
533 |
|
|
|
534 |
<dl> |
|
|
535 |
<dt>Returns: |
|
|
536 |
<code property="yui:return"> |
|
|
537 |
string |
|
|
538 |
</code></dt> |
|
|
539 |
<dd property="yui:returnInfo">JSON string representation of the input</dd> |
|
|
540 |
</dl> |
|
|
541 |
|
|
|
542 |
|
|
|
543 |
|
|
|
544 |
|
|
|
545 |
</div> |
|
|
546 |
|
|
|
547 |
</div> |
|
|
548 |
<hr /> |
|
|
549 |
</div> |
|
|
550 |
</div> |
|
|
551 |
</div> |
|
|
552 |
|
|
|
553 |
</div> |
|
|
554 |
|
|
|
555 |
<div rel="yui:events" resource="#events"> |
|
|
556 |
|
|
|
557 |
|
|
|
558 |
</div> |
|
|
559 |
|
|
|
560 |
<div rel="yui:attributes" resource="#configattributes"> |
|
|
561 |
|
|
|
562 |
</div> |
|
|
563 |
|
|
|
564 |
</div> |
|
|
565 |
</div> |
|
|
566 |
<div class="yui-b"> |
|
|
567 |
<div class="nav"> |
|
|
568 |
|
|
|
569 |
<div id="moduleList" class="module"> |
|
|
570 |
<h4>Modules</h4> |
|
|
571 |
<ul class="content"> |
|
|
572 |
<li class=""><a href="module_anim.html" title="anim">anim</a></li> |
|
|
573 |
<li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li> |
|
|
574 |
<li class=""><a href="module_attribute.html" title="attribute">attribute</a></li> |
|
|
575 |
<li class=""><a href="module_base.html" title="base">base</a></li> |
|
|
576 |
<li class=""><a href="module_cache.html" title="cache">cache</a></li> |
|
|
577 |
<li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li> |
|
|
578 |
<li class=""><a href="module_collection.html" title="collection">collection</a></li> |
|
|
579 |
<li class=""><a href="module_console.html" title="console">console</a></li> |
|
|
580 |
<li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li> |
|
|
581 |
<li class=""><a href="module_cookie.html" title="cookie">cookie</a></li> |
|
|
582 |
<li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li> |
|
|
583 |
<li class=""><a href="module_datasource.html" title="datasource">datasource</a></li> |
|
|
584 |
<li class=""><a href="module_datatype.html" title="datatype">datatype</a></li> |
|
|
585 |
<li class=""><a href="module_dd.html" title="dd">dd</a></li> |
|
|
586 |
<li class=""><a href="module_dom.html" title="dom">dom</a></li> |
|
|
587 |
<li class=""><a href="module_dump.html" title="dump">dump</a></li> |
|
|
588 |
<li class=""><a href="module_event.html" title="event">event</a></li> |
|
|
589 |
<li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li> |
|
|
590 |
<li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li> |
|
|
591 |
<li class=""><a href="module_history.html" title="history">history</a></li> |
|
|
592 |
<li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li> |
|
|
593 |
<li class=""><a href="module_io.html" title="io">io</a></li> |
|
|
594 |
<li class="selected"><a href="module_json.html" title="json">json</a></li> |
|
|
595 |
<li class=""><a href="module_node.html" title="node">node</a></li> |
|
|
596 |
<li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li> |
|
|
597 |
<li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li> |
|
|
598 |
<li class=""><a href="module_oop.html" title="oop">oop</a></li> |
|
|
599 |
<li class=""><a href="module_overlay.html" title="overlay">overlay</a></li> |
|
|
600 |
<li class=""><a href="module_plugin.html" title="plugin">plugin</a></li> |
|
|
601 |
<li class=""><a href="module_profiler.html" title="profiler">profiler</a></li> |
|
|
602 |
<li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li> |
|
|
603 |
<li class=""><a href="module_slider.html" title="slider">slider</a></li> |
|
|
604 |
<li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li> |
|
|
605 |
<li class=""><a href="module_substitute.html" title="substitute">substitute</a></li> |
|
|
606 |
<li class=""><a href="module_test.html" title="test">test</a></li> |
|
|
607 |
<li class=""><a href="module_widget.html" title="widget">widget</a></li> |
|
|
608 |
<li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li> |
|
|
609 |
<li class=""><a href="module_widget-position-ext.html" title="widget-position-ext">widget-position-ext</a></li> |
|
|
610 |
<li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li> |
|
|
611 |
<li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li> |
|
|
612 |
<li class=""><a href="module_yui.html" title="yui">yui</a></li> |
|
|
613 |
</ul> |
|
|
614 |
</div> |
|
|
615 |
|
|
|
616 |
<div id="classList" class="module"> |
|
|
617 |
<h4>Classes</h4> |
|
|
618 |
<ul class="content"> |
|
|
619 |
<li class="selected"><a href="JSON.html" title="JSON">JSON</a></li> |
|
|
620 |
</ul> |
|
|
621 |
</div> |
|
|
622 |
|
|
|
623 |
<div id="fileList" class="module"> |
|
|
624 |
<h4>Files</h4> |
|
|
625 |
<ul class="content"> |
|
|
626 |
<li class=""><a href="json-parse.js.html" title="json-parse.js">json-parse.js</a></li> |
|
|
627 |
<li class=""><a href="json-stringify.js.html" title="json-stringify.js">json-stringify.js</a></li> |
|
|
628 |
</ul> |
|
|
629 |
</div> |
|
|
630 |
|
|
|
631 |
<div id="propertyList" class="module"> |
|
|
632 |
<h4>Properties</h4> |
|
|
633 |
<ul class="content"> |
|
|
634 |
<li class="private"><a href="#property__BRACKETS" title="_BRACKETS">_BRACKETS</a></li> |
|
|
635 |
<li class="private"><a href="#property__ESCAPES" title="_ESCAPES">_ESCAPES</a></li> |
|
|
636 |
<li class="private"><a href="#property__UNICODE_EXCEPTIONS" title="_UNICODE_EXCEPTIONS">_UNICODE_EXCEPTIONS</a></li> |
|
|
637 |
<li class="private"><a href="#property__UNSAFE" title="_UNSAFE">_UNSAFE</a></li> |
|
|
638 |
<li class="private"><a href="#property__VALUES" title="_VALUES">_VALUES</a></li> |
|
|
639 |
<li class=""><a href="#property_JSON.useNativeStringify" title="JSON.useNativeStringify">JSON.useNativeStringify</a></li> |
|
|
640 |
<li class="private"><a href="#property_Native" title="Native">Native</a></li> |
|
|
641 |
<li class=""><a href="#property_useNativeParse" title="useNativeParse">useNativeParse</a></li> |
|
|
642 |
</ul> |
|
|
643 |
</div> |
|
|
644 |
|
|
|
645 |
<div id="methodsList" class="module"> |
|
|
646 |
<h4>Methods</h4> |
|
|
647 |
<ul class="content"> |
|
|
648 |
<li class="private"><a href="#method__revive" title="_revive">_revive</a></li> |
|
|
649 |
<li class=""><a href="#method_dateToString" title="dateToString">dateToString</a></li> |
|
|
650 |
<li class="private"><a href="#method_escapeException" title="escapeException">escapeException</a></li> |
|
|
651 |
<li class=""><a href="#method_parse" title="parse">parse</a></li> |
|
|
652 |
<li class=""><a href="#method_stringify" title="stringify">stringify</a></li> |
|
|
653 |
</ul> |
|
|
654 |
</div> |
|
|
655 |
|
|
|
656 |
|
|
|
657 |
|
|
|
658 |
</div> |
|
|
659 |
</div> |
|
|
660 |
</div> |
|
|
661 |
<div id="ft"> |
|
|
662 |
<hr /> |
|
|
663 |
Copyright © 2009 Yahoo! Inc. All rights reserved. |
|
|
664 |
</div> |
|
|
665 |
</div> |
|
|
666 |
<script type="text/javascript"> |
|
|
667 |
ALL_YUI_PROPS = [{"access": "private", "host": "JSON", "name": "_BRACKETS", "url": "JSON.html#property__BRACKETS", "type": "property"}, {"access": "", "host": "JSON", "name": "dateToString", "url": "JSON.html#method_dateToString", "type": "method"}, {"access": "private", "host": "JSON", "name": "escapeException", "url": "JSON.html#method_escapeException", "type": "method"}, {"access": "private", "host": "JSON", "name": "_ESCAPES", "url": "JSON.html#property__ESCAPES", "type": "property"}, {"access": "", "host": "JSON", "name": "JSON.useNativeStringify", "url": "JSON.html#property_JSON.useNativeStringify", "type": "property"}, {"access": "private", "host": "JSON", "name": "Native", "url": "JSON.html#property_Native", "type": "property"}, {"access": "", "host": "JSON", "name": "parse", "url": "JSON.html#method_parse", "type": "method"}, {"access": "private", "host": "JSON", "name": "_revive", "url": "JSON.html#method__revive", "type": "method"}, {"access": "", "host": "JSON", "name": "stringify", "url": "JSON.html#method_stringify", "type": "method"}, {"access": "private", "host": "JSON", "name": "_UNICODE_EXCEPTIONS", "url": "JSON.html#property__UNICODE_EXCEPTIONS", "type": "property"}, {"access": "private", "host": "JSON", "name": "_UNSAFE", "url": "JSON.html#property__UNSAFE", "type": "property"}, {"access": "", "host": "JSON", "name": "useNativeParse", "url": "JSON.html#property_useNativeParse", "type": "property"}, {"access": "private", "host": "JSON", "name": "_VALUES", "url": "JSON.html#property__VALUES", "type": "property"}]; |
|
|
668 |
</script> |
|
|
669 |
</body> |
|
|
670 |
</html> |