I would like to execute a JavaScript function after the page was loaded. At the moment I have a commandButton and everything works fine. However it would be more comfortable
For primefaces I have managed to successfully use the following:
I have loaded in the JS file containing the functions I needed onLoad by using:
< h:outputScript library="javascript" name="nameOfMyFile.js" target="head">
I have used the following in order to run the JS functions I needed from "nameOfMyFile.js":
< h:body onload="nameOfMyFunction()" >
Please note that my js file also contained the following command at the bottom:
$(document).ready(nameOfMyFunction());
The 3'rd point is for running the function onReady. This was all an experiment to see if I can add HTML to the schedule events ... as the strings passed there are parsed and html tags escaped. I have yet to figure out why I need both onReady and onLoad.... but at the moment it's the only way it worked for me. I will update if I find anything new.
It was successful.