Skip to main content

Bug Tracker

Side navigation

#4977 closed enhancement (wontfix)

Opened July 27, 2009 10:35AM UTC

Closed June 07, 2011 06:53PM UTC

Last modified September 27, 2011 03:55AM UTC

Add $.support for native JSON

Reported by: FarSeeing Owned by:
Priority: low Milestone:
Component: support Version: 1.3.2
Keywords: 1.7-discuss Cc:
Blocked by: Blocking:
Description

Following http://dev.jquery.com/ticket/4429:

Would be nice to add a property in $.support to indicate that browser has a native JSON support:

jQuery.support = {

...,

json: typeof JSON === "object"

}

Attachments (1)
  • jsonSupport.patch (0.4 KB) - added by umbrae November 16, 2009 12:35AM UTC.

    Adds '$.support' checking for native JSON

Change History (21)

Changed November 16, 2009 12:37AM UTC by umbrae comment:1

Patch attached. That rhymes a bit.

Changed June 16, 2010 03:23AM UTC by dmethvin comment:2

component: coresupport

Changed August 09, 2010 01:51AM UTC by dmethvin comment:3

What's the appropriate name for this property? json? nativeJSON?

If/when this is added, update $.parseJSON to use it.

// Try to use the native JSON parser first
return window.JSON && window.JSON.parse ?

becomes

// Try to use the native JSON parser first
return jQuery.support.nativeJSON ?

Changed October 24, 2010 04:57PM UTC by rwaldron comment:4

milestone: 1.41.5
owner: → rwaldron
priority: minorlow
status: newassigned

Changed January 02, 2011 09:20PM UTC by snover comment:5

I can’t help but feel like this will just bloat the code for no reason and would really vote against implementing it. Many of the support tests are fairly complicated and rely on similar markup so it makes sense to run them all at once, but checking for window.JSON is no harder than checking for $.support.json. It’s also shorter.

Changed April 16, 2011 04:39PM UTC by john comment:6

milestone: → 1.next

Yeah, I agree that's it's quite simple, although we are doing that particular feature test every time parseJSON is called (window.JSON && window.JSON.parse). We could easily offload that to jQuery.support.

Changed April 16, 2011 10:01PM UTC by john comment:7

owner: rwaldron
status: assignedopen

Let's look at this for 1.7.

Changed May 22, 2011 07:27PM UTC by john comment:8

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 10:27PM UTC by rwaldron comment:9

description: Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }

+0,

Changed May 22, 2011 11:48PM UTC by jaubourg comment:10

-1, I really don't see what would be gained from this.

Changed May 23, 2011 01:48AM UTC by ajpiano comment:11

description: Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }

-1, This is like putting the treasure map inside of the treasure.

Changed May 23, 2011 02:48AM UTC by timmywil comment:12

description: Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }

-1, Unless we want to do our own JSON compatibility functions, I don't see the need.

Changed May 23, 2011 03:24PM UTC by danheberden comment:13

-1

Changed May 23, 2011 05:17PM UTC by paul.irish comment:14

description: Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }

-1, the detect is trivial, jquery wouldnt help developers with this

Changed May 23, 2011 09:07PM UTC by dmethvin comment:15

-1, If we don't need it, I wouldn't add it.

Changed June 03, 2011 01:13PM UTC by john comment:16

description: Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }

-1, This really isn't needed, at all.

Changed June 03, 2011 02:13PM UTC by scottgonzalez comment:17

-1, Sane detection (and proper detection with Mootools' implementation) are trivial

Changed June 06, 2011 03:37PM UTC by jzaefferer comment:18

-1, needs usecase

Changed June 06, 2011 03:46PM UTC by cowboy comment:19

-1, $.support.JSON vs window.JSON ? I'll take door number 2, thx

Changed June 07, 2011 06:53PM UTC by rwaldron comment:20

milestone: 1.next1.7
resolution: → wontfix
status: openclosed

Closing per 1.7 roadmap meeting resolution

Changed September 27, 2011 03:55AM UTC by dmethvin comment:21

description: Following http://dev.jquery.com/ticket/4429:\ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support:\ \ jQuery.support = {\ ...,\ \ json: typeof JSON === "object"\ }Following http://dev.jquery.com/ticket/4429: \ \ Would be nice to add a property in $.support to indicate that browser has a native JSON support: \ \ jQuery.support = { \ ..., \ \ json: typeof JSON === "object" \ }
milestone: 1.7