Back
Version 3
3/11/2024
const me = document.querySelector(`script[src=${import.meta.url}]`);
if (!me) {
throw new Error("could not find myself");
}
const wrapperID = me.getAttribute("data-element-id");
const wrapper = document.getElementById(wrapperID);
const code = wrapper.textContent;
const iframe = document.createElement("iframe", { is: "iframe" });
iframe.src = `https://https://easrng-playground.web.val.run?code=${encodeURIComponent(code)}`;
wrapper.innerHTML = "";
wrapper.appendChild(iframe);
Updated: March 11, 2024