top of page

Forum Posts

popo Hicintuka
Apr 16, 2020
In Coding with Velo
i am trying to get the product name and post it inside my html but i have this error: Uncaught TypeError: Cannot read property 'postMessage' of undefined. i used debugger and the productName is sent but as the code continue to run something is wix code breaks and i have that error, can anyone please help import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady( async function () { let product = await $w("#productPage1").getProduct(); if (product) { let productName = product.name; $w("#html1").postMessage(productName); } } );
0
3
1k
popo Hicintuka
Apr 12, 2020
In Coding with Velo
i am trying to get the productName on a product page and post a message to html containing the product name, but nothing see to happen, can anyone please help this is code from wix this is my html
how can i send the product name and id to html using postmessage content media
0
1
30
popo Hicintuka
Apr 07, 2020
In Coding with Velo
I have tried to codes in Corvid: Working with the HTML Element but i can't pass a message from the page code to html (iframe) nor from html (iframe) to page code, can you please help if possible or tell me what i did wrong, here is my from from html and js from wix code iframe HTML : <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script data-augment-config='{ "id": "e83d39f812a0eaf25b81fcd6d671aa2d9a4c803e834ef34cc8d87da24c068fd2", "key": "1c6f1a10156efc13625ce1a290ec9d5da71ac80900de11acd8ef6fd89973d19f" }' src="https://cdn.augment.com/web-sdk/1.2/snippet.js"></script> <!-- key and id for test --> <style> #web-viewer-container { width: 100vw; height: 80vh; margin: auto; } button { margin: auto; font-size: 20px; font-weight: bold; line-height: 19.6px; padding: 9px 18px; border-radius: 21px; color: white; background-color: #555555; border: 1px solid #555555; cursor: pointer; } button:hover { background-color: #ed4545;; } </style> </head> <body onload="init()"> <div id="web-viewer-container"> <div class="button"> <button id="web-viewer-button" onclick="displayWebViewer()" style="display: none">View in 3D </button> </div> </div> </body> <script type="text/javascript"> function init () { window.onmessage = (event) => { if (event.data) { console.log("HTML Code Element received a message!"); insertMessage(event.data); } } } function insertMessage(msg) { document.getElementById('demo').innerHTML = msg; sendReturnMessage("Message from the HTML Component!"); } function sendReturnMessage(msg) { window.parent.postMessage(msg, "http://mysite.com"); } </script> </html> wix code js :
not able to send message from html to wix code and the other way around content media
0
1
43
popo Hicintuka
Apr 06, 2020
In Coding with Velo
i'm trying to add SDK JS in a wix website in the product page, so i added everything in a iFrame, the outcome should be a button that gives the users a 3d version of the product, is there a way to connect the code in the iframe and wix code so that in wix code when the product name === X wix code run the code in the iframe. or maybe a way to just connect the database and the code in the iframe through wix code. if anyone could help that would be very appreciated
0
3
100

popo Hicintuka

More actions
bottom of page