Skip to main content

Bug Tracker

Side navigation

#4663 closed bug (invalid)

Opened May 15, 2009 04:48PM UTC

Closed June 12, 2010 02:31PM UTC

$.getJSON can't process data with crlf

Reported by: dolphin Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

$.getJSON will fail when data is

{"a":"123

456

789"}.

I replaced

if ( type == "json" )

data = window["eval"]("(" + data + ")");

with

if ( type == "json" )

data = json_parse(data);http:www.JSON.org/json_parse.js

It worked well.

Attachments (0)
Change History (1)

Changed June 12, 2010 02:31PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

That is not valid json. Any control characters inside a string must be escaped.

http://json.org/