Tengo un problema al obtener los contenidos del sitio web X del sitio web Y Tengo localhost:3000 y http://levshapiro.com
Vi un video de cómo hacerlo y escribí esto:
// localhost:3000 ( PS built on React ) function App() { let url = "http://levshapiro.com"; useEffect(() => { let iframe = document.getElementById("iframe"); iframe.contentWindow.postMessage("HEJ", "*"); }, []) return ( <> <div className="console"> <span id="website_url">Website: {url}</span> </div> <iframe src={url} id="iframe" title="something"/> </> ) } // http://levshapiro.com window.addEventListener("message", function(message) { alert(message.data) }) // + In HTML "<h1>Hello World!</h1>"En este video ( https://www.youtube.com/watch?v=i9nFBZ-MiuQ ) funcionó, pero a mí no. ¿Alguien podría decirme por qué?