tags:

views:

13

answers:

3

hi,

how can I get return value from json string?

how can I parse and read the variable searchxx?

from php: $responce->page = $page; $responce->total = $total_pages; $responce->records = $BC->tot_count; $responce->searchxx = $sSchWhere; $responce->order = $sOrder;

while ($data) ......

echo json_encode($responce);

from html(firebug)

"page":"1","total":2,"records":"26","searchxx":"T0.NAME=pluto" ,"order":"T0.NAME desc","rows":[{"id":"63025c7a-12ad-102c-bd62-005056801340","account_id":"c30c7934-e0f3-102b-8fd4-005056801340","actions":"","edtNAME":"Rossi Mario","edtACCOUNT_NAME":"Rossi Mario<\/a>","edtAREA":"DEMO","edtSTATUS":"Aperta","edtPRIORITY" ......ecc.

tanks, mike.

+1  A: 

Convert JSON string into array using json_decode()

Example:

$array = json_decode($your_json_string);
echo $array['searchxx']; // Should output "T0.NAME=pluto"
Otar
A: 

I reckon http://www.json.org/js.html should help. If not, check out libraries, jQuery, MooTols, etc.

David Kuridža
A: 

I have this code:

  • jQuery("#list2").navGrid('#pager2'{edit:false,add:false,del:false,search:false,refresh:false}) .navButtonAdd('#pager2',{
    caption:"View Condition Where",
    buttonicon:"ui-icon",
    onClickButton: function(){

    alert($("#list2").getGridParam('searchxx')); //Should output NULL }, position:"last" });

how can I get return searchxx from jsondata?