Skip to main content

Bug Tracker

Side navigation

#5985 closed bug (invalid)

Opened January 29, 2010 04:03PM UTC

Closed January 29, 2010 04:13PM UTC

Last modified January 29, 2010 04:19PM UTC

getJSON() callback not working

Reported by: daveartz Owned by:
Priority: major Milestone: 1.4.2
Component: ajax Version: 1.4.1
Keywords: getJSON Cc:
Blocked by: Blocking:

Hey guys.

<script type="text/javascript">

$('#jsonDIV').text('Loading JSON...');

$.getJSON('json.js', function(json){

$('#jsonDIV').text('JSON complete.');



When I run the above code in 1.4.1, the "jsonDIV" text does not change; i.e. the callback does not execute. In Firebug, you can see that json.js is downloaded.

Dave Artz from AOL

Attachments (0)
Change History (3)

Changed January 29, 2010 04:04PM UTC by daveartz comment:1

I meant to mention this code worked in 1.3.2.

Changed January 29, 2010 04:13PM UTC by john comment:2

resolution: → invalid
status: newclosed

You're passing around malformed JSON. "{ ok: true }" is malformed, it would need to be:

{ "ok": true }

More information here:

Changed January 29, 2010 04:19PM UTC by daveartz comment:3

Thanks, that fixed it.

We generally used this method to pass around JavaScript object literals without conforming to JSON standards.

I guess we shall obey the almighty Crockford.