Skip to content

Commit 6632370

Browse files
Add a README
1 parent e2be402 commit 6632370

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
jQuery.stringifyJSON
2+
====================
3+
4+
#### The jQuery.parseJSON's best friend
5+
6+
Converts a value to JSON string.
7+
8+
```js
9+
var json = jQuery.stringifyJSON({name: "Donghwan"});
10+
alert(json === '{"name":"Donghwan"}');
11+
```
12+
13+
`jQuery.stringifyJSON` is useful for those who want to use `JSON.stringify` in browsers which don't implement the JSON object and are reluctant to declare global variable `JSON` and add `toJSON` methods to prototypes, such as plugin developers. In cases where the native `JSON.stringify` is avilable, `jQuery.stringifyJSON` uses it by default.
14+
15+
Because the JSON standard is frozen and this plugin is heavily based on Douglas Crockford's reference implementation, these sources are unlikely to be modified. So, you may take the latest or copy and paste them freely. `jQuery.stringifyJSON` is actually a utility function which has nothing to do with jQuery.

0 commit comments

Comments
 (0)