Execute simple javascript

I want to add a button to my web page and have it execute some java script when the button is pushed.
I found a web page source control… wondering if that is over kill?

Eventually I am sure that my javascript will become a class and then I will probably have to instantiate it and have an instance of it.

Are there any good examples in the installation?

/Extras/WebSDK/ has documentation and examples on how to create custom controls.

Nothing in the WebSDK examples seems to be jumping out to me saying… javascript…

Oh, maybe I misunderstood.

Can you provide some more details of what you’re trying to do?
I thought you were looking to make a custom control with the JavaScript.

I just want to write a javascript class and execute methods off an instance of that class from a button on my web page.

Without more details, difficult to see what you are after. Maybe if you post a sample of the JavaScript you want to execute…

I suppose you have checked http://documentation.xojo.com/index.php/WebControl.ExecuteJavaScript ?

I understand now, I just don’t have the time to do a write up right now.
Brian wants to use a JavaScript (browser side) class, not a Xojo one. Much the way HTML Edit works.

It’s not easy to do in Xojo because things sent by ExecuteJavaScript are executed as an anonymous function, and not retained for use elsewhere. This prevents you from being able to send a class that way. I’ve done it by sending the class to the browser as a WebFile previously, and another time by getting really clever with which objects are storing the class.

I can be more helpful when I have time later this evening.