Set the src of an html box in page code

so Im having an issue when i run this code it tells me that the src is not a valid url. if i take out the // in front it works and displays the code in the html box. i dont want the code displayed in the html box i want it to be used in the html box. any suggestions?


// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixData from “wix-data”; // activates wix-data
import {session} from ‘wix-storage’; // activates wix-storage
$w.onReady( function () {
//TODO: write your page related code here…
let start = session.getItem(‘1’,start);
messageSendButton_onClick(start);
setTimeout(
function ()
{
messageSendButton_onClick(start);
}, 1000);
});
export function messageSendButton_onClick(start) {
// send message to the HTML Component
$w(‘#html1’).postMessage(start);
$w(‘#html1’).src = “//https://www.narrpr.com/widgets/avm-widget/widget.ashx/script”;

}

Tyler, what are you trying to achieve, I don´t get it. In:
export function messageSendButton_onClick(start) {
you first send data to an html-component and right after that you change its URL, rendering thr former postMessage useless. Could you clarify?

Yes, i am trying to use a embedded html widget and so i need to get a var from storage and then “hand it off” to the src. This is my html box code.

so as of now this does not work because the src loads faster than the page can send the var to this box. so the src comes back and says “query is not defined”.

so i was trying to see if i could load the src in the page code to see if the query could be defined before the src went out.

But the rprAvmWidgetOptions never gets to do anything. It´s not sent, nothing. Could you try to explain in text or pseudocode what you are trying to achieve?

the rprAvmWidgetOptions is used in the src