Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Passing Action/Func into JS?

$
0
0
I am trying to pass a C# delegate/Func/Action as a parameter to a Javascript function (on('event',handler)). Right now, the thing that shows up in the JS side is not a function. What is the expected implementation of a function like this?
function myJsFunction(callback) {
  callback();
}
scriptObject.myJsFunction(new Action(() => { /* YAY IT WORKED */ });

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>