In reference to your earlier question: you use the...
# suitescript
e
In reference to your earlier question: you use the User Event
beforeLoad
script to add the button to the form because it runs server-side, before the form loads in the UI for the user. However, the user's browser can only access client-side code, which is where your Client Script comes in. Defining your click handler function in the Client Script makes it accessible to the browser while the user is interacting with the form; the browser doesn't have access to any of your server-side code (like your User Event Script), only the NetSuite backend does.