Re: How to diagnose browser widget JS handlers failing silently?
Thanks for the response, Herman. In the error state I’m getting, the LC JShandler script parameters are empty and so far, I’m having no luck with getting toString(); to stringify javascript objects such that LC doesn’t fail silently. Indeed, your test scripts fail in my situation - so I’m going to have to create a simpler test-bed. Best, Keith > On 14 Nov 2018, at 16:34, hh via use-livecode > wrote: > > You can use the params to see what arrives. > > Most probably you didn't convert the parameters of the handler > in the JavaScript to arrays or strings. > > LiveCode expects strings or arrays as params of javaScriptHandlers. > > So "combine" on the LC side and/or ".toString()" on the JS side are > your friends. > > Example test: > > -- script of the widget (or above it in the message path) > on JS u,v,w -- a javaScriptHandler of widget "browser" > if u is an array then combine u with ":" > put u & cr & v & cr & w > end JS > > on mouseUp > do "var x=[1,2,3], y='hello'; " & \ >"liveCode.JS(x, y, x.toString())" in widget "browser" > end mouseUp > > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: How to diagnose browser widget JS handlers failing silently?
You can use the params to see what arrives. Most probably you didn't convert the parameters of the handler in the JavaScript to arrays or strings. LiveCode expects strings or arrays as params of javaScriptHandlers. So "combine" on the LC side and/or ".toString()" on the JS side are your friends. Example test: -- script of the widget (or above it in the message path) on JS u,v,w -- a javaScriptHandler of widget "browser" if u is an array then combine u with ":" put u & cr & v & cr & w end JS on mouseUp do "var x=[1,2,3], y='hello'; " & \ "liveCode.JS(x, y, x.toString())" in widget "browser" end mouseUp ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
How to diagnose browser widget JS handlers failing silently?
Folks, Is there any way to see the raw message that arrive in LC from javascripts in a browser widget? I’m getting silent failures on some JSHandlers and would like to determine whether it’s JS failing to send (unlikely as they’re variations on working themes) or LC rejecting the inbound message due to syntax, unescaped quotes, etc. Thanks Keith ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode