====== AJAX_CALL_UNKNOWN ====== ---- dataentry event ---- Description: Handle AJAX calls DefaultAction: Sends an "AJAX call unknown!" message. Preventable: yes Added_dt: 2006-08-09 ---- The event is signaled from [[xref>lib/exe/ajax.php]] if the AJAX call is not recognized and allows you to add your own functionality to the AJAX backend. ===== Passed Data ===== The passed [[xref>Doku_Event]] object has the field ''$data''. ''$data'' is a string containing the AJAX call name from %%$_POST['call']%% (or otherwise %%$_GET['call']%%). Add a BEFORE event handler to add your functionality. Check the ''$data'' field for correct call name. Also use a unique AJAX call name to avoid collisions. For example ''plugin_''. Remember to use ''preventDefault()'' to prevent "call unknown" message. Use possibly ''stopPropagation()'' when handling an unknown AJAX event, this keeps other handlers from corrupting your returned data. The AFTER event handler is only executed if ''preventDefault()'' is called by your or another executed BEFORE event handler. Otherwise it is never reached. This AFTER event handler is for normal use cases not useful. ===== See also ===== * [[codesearch>AJAX_CALL_UNKNOWN|Code related to this event]] used in any DokuWiki's files, plugins and templates * [[devel:Action Plugins]] * [[devel:Events]] * Example: [[devel:plugin_programming_tips#Handle JSON ajax request]]