Discussion:
[Wt-interest] Scope of JSlot in doJavaScript
Daniel Moodie
2016-11-10 17:38:37 UTC
Permalink
Hello,

I have a three.js render pane running in a WText via WText::doJavaScript. I can have a Wt::JSignal that emits information from the javascript but I'd also now like to have Wt::JSlot's that can respond to signals emitted from C++.
What I've tried so far is to create a JSlot with the parent being the WText with the javascript three.js rendering that calls a function defined in the javascript. However I think I'm running into scope issues because when the function is called, I get "Wt internal error; code: undefined, description: init is not defined"
So it would seem that the javascript code for my JSlot is not being scoped correctly to access init, however init is defined globally in the script passed into doJavaScript.
Does anyone have some pointers as to how to correct the scope of this?
Loading...