How can I run custom javascript after full loading ticket page?

Could you point me to the code or documents on how could I launch my own javascript script after full ticket page loaded. How to do that?