Getting profile field vals in Javascript?

Is there an easy way to retrieve Profile Document field values in Javascript, as @GetProfileField does in formula language? I have a button for the client that populates several form fields using values saved in a profile document using:

FIELD myField := @GetProfileField(“myProfiledoc”; “myField”; key)

FIELD myField2 := @GetProfileField(“myProfiledoc”; “myField2”; key)

…

…

This is repeated for each field that I want populated on the form with the button. I have an action that works for both client and web that creates/updates a profile document using simple Formula, but on the web my Formula code for inserting profile doc information on my calling form does not update.

I need to write code for a similar button to work on the web side, but I can’t think off the top of my head how to open the specific profile doc in Javascript to retrieve this information, outside of possibly writing an agent that would communicate with both the calling form and the corresponding profile document. As always, any help is much appreciated.