Record details in Javascript

Ability to add field values from current details page inside the Javascript of a page.