0 votes
in Technology by (1.7m points)
How can you call a controller method from JavaScript?

1 Answer

0 votes
by (1.7m points)

To call a controller method (Apex function) from JavaScript, you need to use actionfunction.

Look at the below piece of code to understand how a controller method is called using actionfunction.

1

2

3

4

5

6

<script>

function JSmethodCallFromAnyAction()

{

callfromJS();

}

</apex:page>

...