mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 05:05:02 -05:00
Core: Deprecate jQuery.parseJSON
Fixes gh-2800 Closes gh-2948
This commit is contained in:
@@ -7,7 +7,6 @@ define( [
|
||||
"./ajax/var/rquery",
|
||||
|
||||
"./core/init",
|
||||
"./ajax/parseJSON",
|
||||
"./ajax/parseXML",
|
||||
"./event/trigger",
|
||||
"./deferred",
|
||||
@@ -348,7 +347,7 @@ jQuery.extend( {
|
||||
"text html": true,
|
||||
|
||||
// Evaluate text as a json expression
|
||||
"text json": jQuery.parseJSON,
|
||||
"text json": JSON.parse,
|
||||
|
||||
// Parse text as xml
|
||||
"text xml": jQuery.parseXML
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
define( [
|
||||
"../core"
|
||||
], function( jQuery ) {
|
||||
|
||||
jQuery.parseJSON = JSON.parse;
|
||||
|
||||
return jQuery.parseJSON;
|
||||
|
||||
} );
|
||||
@@ -35,7 +35,7 @@ function dataAttr( elem, key, data ) {
|
||||
|
||||
// Only convert to a number if it doesn't change the string
|
||||
+data + "" === data ? +data :
|
||||
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
||||
rbrace.test( data ) ? JSON.parse( data ) :
|
||||
data;
|
||||
} catch ( e ) {}
|
||||
|
||||
|
||||
@@ -23,4 +23,6 @@ jQuery.fn.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery.parseJSON = JSON.parse;
|
||||
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user