Custom javascript

Hi ,
I cannot find any instruction in the docs how to use custom javascript.
I uploaded a js file ending with a
window.onload =....
to trigger a custom behaviour but I cannot see the expected result.