function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to run Javascript method before methods in controller



Im implementing one method in controller which is used as extension for a page, in the controller I a method which returns a pagereference.


And in the Page I have one JavaScript fiction which displays a alert messages.


But here that alert message was not working because first controller methods are executing first so that the js methods in page is not calling,.


is their any alternate way to execute the js methods first after that only controller methods.



Best Answer chosen by Admin (Salesforce Developers) 


Have you tried using apex:actionFunction in the VF page.