WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #14618


Ignore:
Timestamp:
08/15/10 14:26:08 (4 years ago)
Author:
filosofo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14618 – Description

    v1 v2  
    4747A response to the previous might look like this: 
    4848 
    49 `{"jsonrpc": "2.0", "result": "deleted", "id": 4567}` 
     49`{"jsonrpc": "2.0", "result": {"action":"deleted", "commentID":123}, "id": 4567}` 
    5050 
    5151WordPress would provide the JS for making the JSON requests, attaching listeners and matching responses to the appropriate callbacks by ID. Perhaps like so: 
     
    5555 
    5656function myCallback( result ) { 
    57         alert('Comment ID #' + result + ' deleted!'); 
     57   if ( 'deleted' == result.action ) 
     58        alert('Comment ID #' + result.commentID + ' deleted!'); 
    5859} 
    5960