[wp-trac] [WordPress Trac] #14618: Proposal: Standardize WP Responses to JS Requests as JSON
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 26 00:31:17 UTC 2010
#14618: Proposal: Standardize WP Responses to JS Requests as JSON
-------------------------+--------------------------------------------------
Reporter: filosofo | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: JavaScript | Version: 3.0
Severity: normal | Keywords: needs-patch
-------------------------+--------------------------------------------------
Comment(by dd32):
It should be worth noting here, That we do actually have a "standard"
library for communication, the WP_Ajax_Response PHP Class and the WP Ajax
Javascript library..
JS Library: http://core.trac.wordpress.org/browser/trunk/wp-includes/js
/wp-ajax-response.dev.js An implementation of it as a reciever:
http://core.trac.wordpress.org/browser/trunk/wp-
includes/js/autosave.dev.js#L85
The PHP Class: http://core.trac.wordpress.org/browser/trunk/wp-
includes/classes.php#L1673 An implementation of sending it:
http://core.trac.wordpress.org/browser/trunk/wp-admin/admin-
ajax.php?rev=15956#L363
The major problem with these libraries, is that people do not understand
how to use them.. The 0/1 responses are valid and carry a known
explanation, and the XML structures returned are also of a standard
quantity.
If anything, This ticket should focus on integrating well with jQuery as
well as being simple/powerful enough for 99% of developers to understand
the code.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14618#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list