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
Luke@TWSLuke@TWS 

Accessing Apex data from Javascript

I'm building a VF page, part of it requires some javascript to run some client side UI functionality which requires information from another object. Is there any way to access the data in the controller directly using Javascript? should I be making hidden fields and populating these with the data? or should I get the session ID and use AJAX to get the data separately?
vivinmathewpvivinmathewp

Yes you can access controller fields in javascript.

alert('{!$CurrentPage.parameters.currentTab} Current Tab');

The above example shows how to access the query string parameter currentTab in javascript.

Thanks,

Harvin