[wp-hackers] AJAX Hooks and JSON String

Prasanth Gangaraju gprasanth.1992 at gmail.com
Sat Sep 24 20:06:58 UTC 2011


>
> I'm currently struggling to work out how to add the 'action' and a
> corresponding value into my JSON string,
>

refer to [1].
what you need to do to *add* the action and corresponding value to your
current json string is this:
say your current string is s
say postData is your final json string. then,

> postData = "{ [action:\"my_action\", data:\""+s+"\"]}";
>
this is exactly what you need to do.

[1] http://www.json.org/

-- 
Prasanth


More information about the wp-hackers mailing list