1.引用JS文件
<af:document> <af:resource type="javascript" source="/customJsCode.js"/>
…
</af:document>
2.定义JS代码
3.客户端组件
1)使用af:clientListener来监听组件的各种事件。设置组件的clientComponent属性 为 true。
2)获得组件
<af:document> <af:resource type="javascript" source="/customJsCode.js"/>
…
</af:document>