Hey @dorilama, where could I find more info about functions like wwLib.getFrontDocument()?
It is not in the API Guide API Reference | weweb.io developer documentation, for example.
I have seen you comment quite a few useful answers using, say, getFrontDocument() and I would love to learn more about it.
You probably need only getFrontDocument.
There is some mention in the docs.
You can inspect and read the code with the developers tools.
You can ask the weweb team.
Hi,
a quick explanation: inside the editor, the preview application is load inside an iframe. Depending on where you code is executing, document can refer to the editor main document, or the document of the iframe.
As dorilama said, you probably want to always target the app document, so wwLib.getFrontDocument(), which will work in all context (in published app as well)