作者:飞天6585_439 | 来源:互联网 | 2023-09-14 21:39
PHPreturnsvaluewith1-2seconddelayjQuery.postdoesntwaitforresponse.PHP以1-2秒延迟返回值jQuery.
PHP returns value with 1-2 second delay jQuery.post doesn't wait for response.
PHP以1-2秒延迟返回值jQuery.post不等待响应。
How do you think, is it possible to fix that problem and wait for response?
您如何看待,是否可以解决该问题并等待响应?
$.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" );
Note the same function with get works well
注意相同的功能与get工作得很好
$.getJSON( sSource, aoData, function (json) {
/* Callback processing */
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)
} );
1 个解决方案