using Action function we can invoke a method from java script and also by Action support?so when should we go for both these two if both have same functionality?plz help me?
Both are somewhat different and have different purpose:
ActionFunction A component that provides support for invoking controller action methods directly from JavaScript code using an AJAX request.
You can use this when you want to invoke a controller method from your JS code.(By JS code, I mean a code written within <script></script> tags.)
ActionSupport Adds AJAX support to another component, allowing the component to be refreshed asynchronously by the server when a particular event occurs.
You can use this when you want to invoke say a controller method on some event like "onclick". You cannot call the method defined in action attribute from any JS code of your page using actionsupport.
ActionFunction
A component that provides support for invoking controller action methods directly from JavaScript code using an AJAX request.
You can use this when you want to invoke a controller method from your JS code.(By JS code, I mean a code written within <script></script> tags.)
ActionSupport
Adds AJAX support to another component, allowing the component to be refreshed asynchronously by the server when a particular event occurs.
You can use this when you want to invoke say a controller method on some event like "onclick". You cannot call the method defined in action attribute from any JS code of your page using actionsupport.