Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5975 closed enhancement (wontfix)

Set Option for parseJSON to use JSON or Function

Reported by: indianajones Owned by:
Priority: major Milestone: 1.4.2
Component: ajax Version: 1.4.1
Keywords: parseJSON, option Cc:
Blocked by: Blocking:

Description

Expose a setting which allows parseJSON to either use window.JSON (if available) or not. This would eliminate a problem with the generation of JSON objects that contain dates.

For instance, if we define the value for a date such as {"birthday": new Date(1262318400000)}" this is not a 'pure' JSON object and thus fails using the window.JSON call but will work as a javascript evaluation or declaration.

This would be a very small change and would eliminate many additional javascript calls required when working with newly created objects to check for the presences of dates.

Change History (2)

comment:1 Changed 10 years ago by dmethvin

As an alternative, consider using JSONP or fetching script.

comment:2 Changed 10 years ago by john

Resolution: wontfix
Status: newclosed

This wouldn't do anything since we pre-check the JSON string to see if it's valid - and what you have there isn't valid, it would throw an error regardless. This isn't something that we're likely to change.

Note: See TracTickets for help on using tickets.