I have a page that needs some scripts but is included in its top level page via <a4j:include>. If I put the <a4j:loadScript> tags on the top level page everything works like it should.
One of the scripts needs to call a function that is defined by <a4j:jsFunction>, wich can be defined on the top level page or the included page. So this isn't a big problem.
However, since the scripts only apply to one particular included (content) page (navigating in the app only replaces the content page), I'd like to only load the scripts there. Especially the script that uses the jsFunction only applies to the one content page, so it would be dangerous to allow other pages to access that function.
Is there a way to get scripts loaded during an ajax include?
Btw, I'm using RF 3.3.2.SR1, Facelets 1.1.14 and Mojarra 1.2_13.