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
kgrasukgrasu 

How can we pass a javascript value to a VF controller method without user interaction

Hi,
 
We have a visualforce page that has a javascript function which initializes a var to some value. We need to pass this value to the controller of the visualforce page "without" any user interaction like onclick, onkeypress etc. How can we acheive this? Is there an equivalent functionality like *page onload* that can invoke a controller method?
 
Thanks and regards
Rasu
Arun BalaArun Bala
You can call the JS function on body onload. From the JS function call a actionFunction that will make a ajax call to the controller class. HTH.