Quantcast
Channel: The book of inspiration » javascript
Viewing all articles
Browse latest Browse all 10

updated example: ExposedFunctions

$
0
0

Today I have extended the ExposedFunctions example. In our scenario we have written a javascript library in c# with jsc and we would like to consume some of its exposed functionality. We are going to edit our html file with Visual Studio inside the WebApplication1 subproject.

In the previous version the API consumer was only able to set text and index fields.

ExposedFunctions1

This time around the consumer is able to optionally specify mouse handlers and invoke GetString function on demand in javascript.

ExposedFunctions2

In this html file I have added two new buttons to consume the exposed API. The Example2 button will react on mouseover and mouseout events. Clicking on the data will invoke the onclick handler in which we will invoke the C# code to provide us some text to be displayed.

ExposedFunctions3


Tagged: javascript

Viewing all articles
Browse latest Browse all 10

Trending Articles