When we create a JSF page, a client request allows generation of HTML dynamically using a combination of Java code and HTML.
Can we introduce hooks in the HTML page using JS
You can have a look at Seam (see this article for a discussion to use Seam with JSF and AJAX).
When I used Seam the last time, it was pretty slow, though. You may want to create your own JSF component that generates JavaScript (for example using jQuery as explained in this article).