![]() ![]() We define the button_click() function to send the text in the HTML element's text input to the data sent to the page code. ![]() Next, when the button in the HTML element is clicked, it calls the button_click() function. This event handler is called each time the HTML element receives a message from the page code. There are two parts to the messaging logic.įirst, when the HTML element loads, we set its onMessage property to an event handler that sets the text of the element's to be the data sent from the page code. When I load a page that has an iframe, often (perhaps always) I cant see the content of that iframe using the browsers View -> PageSource menu choice. In the tag, we define our messaging logic. We are just using them to mimic the design of the Wix page elements. In the tag, we define some styles that are used by the HTML elements mentioned above. An that is used for entering the message to send to the page code.A that is used for sending messages to the page code.A that is used to display messages received from the page code.Similar to what we created using Wix page elements, we have: In the tag, we define the HTML elements that make up our page. The following code is added to the HTML element using the Edit Code button. But if the widget or library just needs to send data to or receive data from your page elements, you can write code to make it work. This means that widgets or libraries that need access to the rest of your page will not work in an HTML element. You can, however, pass data between your page code and the code in an HTML element. The HTML element creates a sandboxed environment (an iframe) that does not have direct access to the other elements on your page. Using an HTML element you can sometimes overcome these limitations by adding raw HTML to your page. This can sometimes be limiting when you want to add 3rd party code to your site. In general, you do not have access to the HTML and full code of your site's pages. That means you can use it in all sorts of situations to do things you can't normally do directly, even when using Velo. You can also pass data between your page code and the code in an HTML element. Visit the Velo by Wix website to onboard and continue learning.Īn HTML element allows you to add raw HTML or embed another website within your page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |