Skip to content

Instantly share code, notes, and snippets.

@cycold
Created August 20, 2014 07:51
Show Gist options
  • Save cycold/0bd5ead7f457fcf80638 to your computer and use it in GitHub Desktop.
Save cycold/0bd5ead7f457fcf80638 to your computer and use it in GitHub Desktop.
json解析
if( typeof( data ) === 'string' ) {
dataTemp1 = JSON.parse( data );
dataTemp2 = $.parseJSON( data );
dataTemp3 = eval('(' + data + ')' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment