Instead of calling JNotify directly in your code, use Dolibarr’s setEventMessage tool. Dolibarr provides the configuration option DISABLE_JQUERY_JNOTIFY, which disables the jQuery JNotify system, usually because another notification library will be used instead.

If you rely on Dolibarr.tools.setEventMessage(), your code remains compatible even if the underlying notification system changes. The setEventMessage tool can be replaced internally without requiring any changes in your modules or custom scripts.

This means all developers can write features without worrying about frontend compatibility or future library replacements. Enjoy!

" >', ' document.addEventListener(\'Dolibarr:Ready\', function(e) {', '', ' document.getElementById(\'setEventMessage-success\').addEventListener(\'click\', function(e) {', ' Dolibarr.tools.setEventMessage(\'Success Test\');', ' });', '', ' document.getElementById(\'setEventMessage-error\').addEventListener(\'click\', function(e) {', ' Dolibarr.tools.setEventMessage(\'Error Test\', \'errors\');', ' });', '', ' document.getElementById(\'setEventMessage-error-sticky\').addEventListener(\'click\', function(e) {', ' Dolibarr.tools.setEventMessage(\'Error Test\', \'errors\', true);', ' });', '', ' document.getElementById(\'setEventMessage-warning\').addEventListener(\'click\', function(e) {', ' Dolibarr.tools.setEventMessage(\'Warning Test\', \'warnings\');', ' });', '', ' });', '', ); $documentation->showCode($lines, 'php'); ?>