top of page

Forum Posts

chade li
Nov 15, 2019
In Coding with Velo
Hi, I want to pass a value from window to HTML iframe, I have been trying the onmessage function for a while but still do not know how to use it. <html>   <head>     <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>     <script type="text/javascript">       google.charts.load('current', {'packages':['corechart']});       google.charts.setOnLoadCallback(drawChart);       function drawChart() {         var data = google.visualization.arrayToDataTable([           ['Year', 'Sales', 'Expenses'],           ['2004',  1000,      400],           ['2005',  1170,      460],           ['2006',  660,       1120],           ['2007',  1030,      540]         ]);         var options = {           title: 'Company Performance',           curveType: 'function',           legend: { position: 'bottom' }         }; window.onmessage = (event) => { if (event.data) { let receivedData = event.data; } };         var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));         chart.draw(data, options);       }     </script>   </head>   <body>     <div id="curve_chart" style="width: 900px; height: 500px"></div>   </body> </html> This is a line chart, I am trying to pass data to the chart from my window, how can "receivedData" be inserted into the chart?
0
1
166
chade li
Oct 04, 2019
In Coding with Velo
Hi, I am trying to stop a hook being called after insert, but the supressHooks seems not working well. let toInsert = { "title": "Mr.", "first_name": "John", "last_name": "Doe" }; let options = { "suppressAuth": true, "suppressHooks": true, }; wixData.insert("bid", toInsert, options) //data.js export function bid_afterInsert(item, context) { //TODO: write your code here... console.log("hook fired") return(item) } I tried to switch "supressHooks" to be true and false, but the hook runs anyways, what should I do?
0
2
104

chade li

More actions
bottom of page