PHP returns a value with a delay of 1-2 seconds jQuery.post does not wait for a response.
Do you think it possible to fix this problem and wait for an answer?
$.post( sSource, aoData, function (data) { oCache.lastJson = jQuery.extend(true, {}, data); if ( oCache.iCacheLower != oCache.iDisplayStart ) { data.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower ); } data.aaData.splice( oCache.iDisplayLength, data.aaData.length ); abc(oCache); fnCallback(data); },"json" );
Pay attention to the same function as get works
$.getJSON( sSource, aoData, function (json) { oCache.lastJson = jQuery.extend(true, {}, json); if ( oCache.iCacheLower != oCache.iDisplayStart ) { json.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower ); } json.aaData.splice( oCache.iDisplayLength, json.aaData.length ); fnCallback(json) } );
heron source share