public function macroOnLoad(MacroNode $node, PhpWriter $writer): string
	{
		if ($node->args == '') {
			throw new CompileException('Missing function name argument in {onLoad} macro.');
		}
		return $writer->write('
            if($presenter->isAjax()) {
                echo "' . $node->args . '();";
            }else{
                echo "if (window.addEventListener) {
                    window.addEventListener(\'load\', ' . $node->args . ', false);
                } else if (window.attachEvent) {
                    window.attachEvent(\'onload\', ' . $node->args . ');
                } else {
                    window.onload = ' . $node->args . ';
                }";
            }');
	}