开发者

how to call opa functions from external scripts or embeded content like flash plugins

开发者 https://www.devze.com 2023-04-04 01:20 出处:网络
as the title says, dos anyone know a way how to call functions I define in opa from external scripts or embeded content on the client side.

as the title says, dos anyone know a way how to call functions I define in opa from external scripts or embeded content on the client side.

In other words, the opposite direction of what is explained in the 8. Hello, reCaptcha (and the rest of the world) example.

In my special case I got an interactive, embeded plugin from where i can ca开发者_JAVA技巧ll js functions defined in the browser context. But how do I need to define them in opa, so I can call them.


Yes, one of the difficulties is to guess the name of the Opa-generated functions in JS.

In Opa, there is a directive @js_ident such that @js_ident("name_of_a_function") is the string of the function at runtime. I think, this doesn't help you much, though.

However, I think you can expose in JS a registering function (that puts its argument in reference), and call it from Opa with the Opa function you want to call as argument.


I think it's pretty hard, or maybe impossible. Opa javascript function are generated, so you can't really guess their name, arguments, etc...

0

精彩评论

暂无评论...
验证码 换一张
取 消