开发者

large data processing error in JSON and php

开发者 https://www.devze.com 2023-03-23 18:13 出处:网络
i have one php page with request data from other page using JSON i have ajax call $.ajax({ type: \"POST\",

i have one php page with request data from other page using JSON

i have ajax call

 $.ajax({
             type: "POST",
             url: "getdata.php",
             cache:false,
             data:"list_id="+ encodeURICompo开发者_JAVA百科nent(cont_list),
             dataType:'json',
             success: function(json)
             {
            var foo = json.foo;
            $(foo).addClass('innertxt');
            $('#all_users').append(foo);
         }

after data is processed in 2nd php file it send back in bellow symtax

$return["foo"] =$val;

print stripslashes(json_encode($return));

$val is variable with data. it works fine for small amount of data but if records are in thousands like 5,000 to 50,000 or more it didn't work and it shows bellow error in firebug

script stack space quota is exhausted

how can i process and get result of big data.

Thanks


I think you could compress your json tp gzip format data. The json string is text, so after compression, you will get a very much smaller response. About how to compress your response data in php, please check here

0

精彩评论

暂无评论...
验证码 换一张
取 消