Exactly. You do not execute javascript on the server - you render it in the render method to send it to the client to be executed. If you are trying to send javascript to the client then put it in the render/prerender method. Apparently the unload method is too late to render output.
>I think this kind of process cannot apply. I would say any javascript process cannot be executed as the page is not loaded on the client at that moment.