pass a list of objects to HTML element using postMessage

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?

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!

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.