DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:event:ajax_call_unknown

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
devel:event:ajax_call_unknown [2009-03-03 17:42] 82.224.163.148devel:event:ajax_call_unknown [2018-12-08 14:57] (current) – doc updated according to issue #2615 torpedo
Line 11: Line 11:
  
 ===== Passed Data ===== ===== Passed Data =====
 +The passed [[xref>Doku_Event]] object has the field ''$data''.
  
-$data is a scalar containing the AJAX call name in %%$_POST['call']%%.+''$data'' is a string containing the AJAX call name from %%$_POST['call']%% (or otherwise %%$_GET['call']%%).
  
-Remember to use ''preventDefault()'(and possibly ''stopPropagation()'') when handling an unknown AJAX event. This keeps other handlers from corrupting your returned data. Also use a unique AJAX call name to avoid collisions+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_<pluginname>''.
  
-===== Plugins handling this event =====+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 following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.+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.
  
-  * Link to the [[plugintag>ajax|ajax plugins]] 
-  * FIXME 
  
 ===== See also ===== ===== See also =====
  
 +  * [[codesearch>AJAX_CALL_UNKNOWN|Code related to this event]] used in any DokuWiki's files, plugins and templates
   * [[devel:Action Plugins]]   * [[devel:Action Plugins]]
   * [[devel:Events]]   * [[devel:Events]]
 +  * Example: [[devel:plugin_programming_tips#Handle JSON ajax request]]
  
  
devel/event/ajax_call_unknown.1236098556.txt.gz · Last modified: 2009-09-11 19:06 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki