Im trying to use the postMessage function and pass a db element (with references) to the javascript inside.
Whats the best way to go about doing that?
do I need to serialize & deserialize inside?
and does corvid provide tools to do that?
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
Interesting question, Refael. I guess what you mean by a "list" of objects is an array of objects, like [{},{}]. I don´t think you have to stringify/parse. I communicated JS-arrays of strings without a hitch, and I guess (but that is it, a guess), the same would go for arrays of objects. Also note that this is slightly OT. For these kind of solutions, try stackoverflow, you will find tons of answers.
Good luck.
Hi.
You can add an onViewPortEnter event to the HTML element then query the database in the event code and pass results to the postMessage function.
Refer to this article to learn more: Corvid: Working with the HTML Element
Good luck!