Forum Discussion
SamHill
8 months agoSuper Hero
Hi Jim, you would need to assign the URL to the "SRC" attribute of the iframe associated with the WebObject. For example, the WebObject iframe might look something like this:
<iframe data-dv_ref="iframe" data-dv_src="http://www.google.com" src="http://www.google.com" allowfullscreen="" class="shown " tabindex="0" aria-hidden="false"></iframe>
So you would have to first get the iframe. I'm using the src attribute value to make sure I get the correct iframe.
const $newurl = "https://community.articulate.com/"
const $iframe = document.querySelector("iframe[src='http://www.google.com']");
$iframe.setAttribute("src", $newurl);