
calling controller method from javascript in salesforce?
In salesforce we use java script either in a visualforce page or we
execute javascript on custom button (i.e a custom button is override
with a java script). While the java script is being executed we may
require to call a controller class method which may have a piece of code
required for custom functionality. In case of visualforce page we may
use action function which can call the controller method from java
script directly.
For calling a controller method from java script written to override a
custom button, we need to use AJAX method callout. In the example below,
...