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

1 Answer

0 votes
by (321k 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>

...