#7521 closed bug (invalid)
1.4.4 - jQuery.parseJSON(string_with_only_whitespaces like ' ') throws an exception
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | unfiled | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I don't know whether this is expected behavior but jQuery 1.4.4 raises an exception when you try jQuery.parseJSON with a string which contains onyl whitespaces.
This occurs for example when you do a Ajax request (dataType: 'json') and the server returns just a string with one or more whitespaces.
I'm using Chrome 7.0.517.44 on ubuntu/linux so it uses the native parser (window.JSON.parse() )
Change History (4)
comment:1 Changed 12 years ago by
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
http://json.org/ indicates the minimal valid json is '{}'.
comment:4 Changed 12 years ago by
quite right, I'm taking this to the rails team, as this came up when using rails with ajax and json requests.
Thx for your help.
Note: See
TracTickets for help on using
tickets.
added jsFiddle example http://jsfiddle.net/SYQvW/4/