#4977 closed enhancement (wontfix)
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 (last modified by )
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 (22)
Changed 8 years ago by
Attachment: | jsonSupport.patch added |
---|
comment:2 Changed 8 years ago by
Component: | core → support |
---|
comment:3 Changed 8 years ago by
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 ?
comment:4 Changed 7 years ago by
Milestone: | 1.4 → 1.5 |
---|---|
Owner: | set to Rick Waldron |
Priority: | minor → low |
Status: | new → assigned |
comment:5 Changed 7 years ago by
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.
comment:6 Changed 7 years ago by
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.
comment:7 Changed 7 years ago by
Owner: | Rick Waldron deleted |
---|---|
Status: | assigned → open |
Let's look at this for 1.7.
comment:11 Changed 7 years ago by
Description: | modified (diff) |
---|
-1, This is like putting the treasure map inside of the treasure.
comment:12 Changed 7 years ago by
Description: | modified (diff) |
---|
-1, Unless we want to do our own JSON compatibility functions, I don't see the need.
comment:14 Changed 7 years ago by
Description: | modified (diff) |
---|
-1, the detect is trivial, jquery wouldnt help developers with this
comment:16 Changed 7 years ago by
Description: | modified (diff) |
---|
-1, This really isn't needed, at all.
comment:17 Changed 7 years ago by
-1, Sane detection (and proper detection with Mootools' implementation) are trivial
comment:20 Changed 7 years ago by
Milestone: | 1.next → 1.7 |
---|---|
Resolution: | → wontfix |
Status: | open → closed |
Closing per 1.7 roadmap meeting resolution
comment:21 Changed 7 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.7 |
Adds '$.support' checking for native JSON