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)
Change History (21)
Changed November 16, 2009 12:37AM UTC by comment:1
Changed June 16, 2010 03:23AM UTC by comment:2
component: | core → support |
---|
Changed August 09, 2010 01:51AM UTC by 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 comment:4
milestone: | 1.4 → 1.5 |
---|---|
owner: | → rwaldron |
priority: | minor → low |
status: | new → assigned |
Changed January 02, 2011 09:20PM UTC by 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 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 comment:7
owner: | rwaldron |
---|---|
status: | assigned → open |
Let's look at this for 1.7.
Changed May 22, 2011 07:27PM UTC by comment:8
keywords: | → 1.7-discuss |
---|
Nominating ticket for 1.7 discussion.
Changed May 22, 2011 10:27PM UTC by 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 comment:10
-1, I really don't see what would be gained from this.
Changed May 23, 2011 01:48AM UTC by 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 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 comment:13
-1
Changed May 23, 2011 05:17PM UTC by 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 comment:15
-1, If we don't need it, I wouldn't add it.
Changed June 03, 2011 01:13PM UTC by 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 comment:17
-1, Sane detection (and proper detection with Mootools' implementation) are trivial
Changed June 06, 2011 03:37PM UTC by comment:18
-1, needs usecase
Changed June 06, 2011 03:46PM UTC by comment:19
-1, $.support.JSON vs window.JSON ? I'll take door number 2, thx
Changed June 07, 2011 06:53PM UTC by comment:20
milestone: | 1.next → 1.7 |
---|---|
resolution: | → wontfix |
status: | open → closed |
Closing per 1.7 roadmap meeting resolution
Changed September 27, 2011 03:55AM UTC by 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 |
Patch attached. That rhymes a bit.