I figured out how to do it. I have a free button with a custom link. When I click on the plus sign next to custom, and a popup window opens, I added my function call in the Javascript field, testing();, saved and closed this field. Then I created a Javascript field - type, "script (JS)", added it to the hidden position in the form layout, when I edit the field, I set behavior "Raw", in the JS field, added the testing function:
function testing()
{
alert("Hi There!");
}
Saved and closed the field, saved the form. These fields were under the Site tab. I opened the form in the front end browser, clicked on the button, and it displayed the alert window. It found the function and ran it.