As described in the 4th Dimension Language Reference manual, you can bind a 4D method to an HTML object by specifying /4DMETHOD/Name_of_your_method as the URL for the link. For details, see the Language Reference manual section Web Services, Your First Time (Part II).
There is an undocumented point of information regarding this feature — 4th Dimension sends a text parameter to any 4D method called via a URL. Regarding this text parameter:
• Although you do not use this parameter, you must explicitly declare it with the line C_TEXT($1), otherwise runtime errors will occur while using the Web to access a database that runs in compiled mode.
• This parameter returns the extra data placed at the end of the URL, and can be used as a placeholder for passing values from the HTML environment to the 4D environment.