Hi all,
I am having troubles wrapping my head around the concept of the WebSDK and external libraries.
I need to include two libraries, jQuery and one that builds upon jQuery.
So in the Open event, I load those libraries using LoadLibraries and pass a callback function that then implements the included functions (of those libraries) in my custom control. I register the libraries with RegisterLibrary so I can check in a second instance if I need to call LoadLibraries or if it’s already been sent to the browser. So far, so good.
However, after having loaded the jQuery library and calling the famous “$” function (to obtain a DOM-handle), Xojo interrupts and says: “Could not execute returned javascript: $ is not defined”. The DOM however clearly shows that the library is loaded (it’s included in the head-tags) and the function get’s called (in the shown event) after the library has been loaded (in the open event). Could it be that the library hasn’t actually been loaded even though the shown event has already been called?
Debugging JS in the WebSDK is still a pain in the /\$$…
Thanks for your support,
Alex