Working with Datatables. Trying to get work function (which currently works ONLY with GET) with POST.
Based on this discussion I modified this function and got something like below. Now getting error message:
json.aaData is undefined @ line 99
jQuery.post( sSource, aoData, function (data) {
/* Callback processing */
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 );
fnCallback(data)
},"json" );
}
else
{
json = jQuery.extend(true, {}, oCache.lastJson);
json.sEcho = sEcho; /* Update the echo for each response */
json.aaData.splice( 0, iRequestStart-oCache.iCacheLower ); // <- this line
json.aaData.splice( iRequestLength, json.aaData.length );
fnCallback(json);
return;
}
}
What am I missing? Any suggestion?
jQueryin its long form once? By wrapping your code in(function($) { .... })(jQuery);, you can use$no matter ifnoConflicthas been used or not.