How do I connect dataset to html <iframe>?

Hello all,

I have an html iframe with javascript inside of it, and I have a wix dataset connection.
I am using the iframe to display a Google Map route, and I want the start point to be some current location, and the end point to be a value contained in the wix dataset connection (assume the value is the address to navigate to).

Using an html iframe, how do I connect the value of the dataset into the actual code of html so that the variable containing ‘endpoint address’ will be populated by the dataset connection?

I want:
var endPoint = “WIXDATABASEVALUE”

Please advise on how to do this.
The API tutorial says to import some wix-code… but please tell me exactly how to place this inside my html iframe as if I am a 5 year old.

Thank you.

See HtmlComponent,
Pass message to HtmlComponent,
See HtmlComponent run,
Run HtmlComponent, run.

You need to pass the values to the code in the HtmlComponent using messages. See the article Working with the HTML Component in Wix Code for details.

For a working example complete with messaging, see the Example: Multiple Markers Google Maps .

Good luck,

Yisrael

1 Like