Manual:Hooks/AjaxAddScript

From mediawiki.org
Jump to navigation Jump to search
AjaxAddScript
Available from version 1.9.1
Called in output page just before the initialization
Define function:
public static function onAjaxAddScript( &$out ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AjaxAddScript": "MyExtensionHooks::onAjaxAddScript"
	}
}
Called from:File(s): OutputPage.php
Interface:AjaxAddScriptHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:AjaxAddScript extensions.

Details[edit]

  • &$out: OutputPage object

Notes[edit]

  • This hook is only called when ajax is enabled ($wgUseAjax = true)