In The below code the submitEmp() method not working can any one tell me how to call the javascript function through the ActionFunction
<script>
function innerJavascript(){
alert('Start invoking vf action!');
submitEmp();
}
</script>
CONTROLLER
public pageReference submitEmp(){
EMPTest__c c= new EMPTest__c();
insert c;
return null;
}
Best Answer
I think you're confusing some things. Actionfunctions are to expose controller (apex) methods to javascript. Actionfunctions are not to call javascript methods from apex. You may do well to read the ActionMethod documentation and examples.
Though Looking at your included code, it IS what you are looking for: