31,003
edits
| Line 358: | Line 358: | ||
'''When''': If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js) | '''When''': If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js) | ||
If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions defined into | If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions, defined into your javascript file '''htdocs/mymodule/js/mymodule.js''', included into the HTML HEAD section. | ||
To ask Dolibarr that forge this header to include your own javascript file, you must just | To ask Dolibarr that forge this header to include your own javascript file, you must just provide it to the llxHeader() function called by your page. | ||
Example: | |||
<source lang="php"> | |||
$morejs=array("/monmodule/js/monmodule.js"); | |||
llxHeader('','Titre','','','','',$morejs,'',0,0); | |||
</source> | |||
= [[File:Art.png]] Run your own code on any Dolibarr event (optional) = | = [[File:Art.png]] Run your own code on any Dolibarr event (optional) = | ||