I solved a similar problem, by just starting from scratch the other day. There doesn't seem to be any problem, with getting hand-written or cloned html, to work with B4J.
But working with Third Party-generated html, is presenting issues.
The attached is a simple example, no external css, just a simple B4J app, using Web Sockets, and a single Text box. It's generated from an Html designer, then exported.
The text box gets shown correctly, but the WebSocket_Connected routine is never reached.
What am I missing? Is there another javascript module that should be pointed to?