Skip to content

Commit 956f186

Browse files
AurelioDeRosatimmywil
authored andcommitted
jQuery.parseJSON: Added deprecation note for jQuery 3
Fixes jquerygh-898 Closes jquerygh-899
1 parent d6d3e7a commit 956f186

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

entries/jQuery.parseJSON.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<entry type="method" name="jQuery.parseJSON">
2+
<entry type="method" name="jQuery.parseJSON" deprecated="3.0">
33
<return type="String"/>
44
<return type="Number"/>
55
<return type="Object"/>
@@ -26,6 +26,7 @@
2626
<p>The JSON standard does not permit "control characters" such as a tab or newline. An example like <code>$.parseJSON( '{ "testing":"1\t2\n3" }' )</code> will throw an error in most implementations because the JavaScript parser converts the string's tab and newline escapes into literal tab and newline; doubling the backslashes like <code>"1\\t2\\n3"</code> yields expected results. This problem is often seen when injecting JSON into a JavaScript file from a server-side language such as PHP.</p>
2727
<p>Where the browser provides a native implementation of <code>JSON.parse</code>, jQuery uses it to parse the string. For details on the JSON format, see <a href="http://json.org/">http://json.org/</a>.</p>
2828
<p>Prior to jQuery 1.9, <code>$.parseJSON</code> returned <code>null</code> instead of throwing an error if it was passed an empty string, <code>null</code>, or <code>undefined</code>, even though those are not valid JSON.</p>
29+
<p>As of jQuery 3.0, <code>$.parseJSON</code> is deprecated. To parse JSON objects, use the native <code>JSON.parse</code> method instead.</p>
2930
</longdesc>
3031
<example>
3132
<desc>Parse a JSON string.</desc>

0 commit comments

Comments
 (0)