i have a page Data.html hosted on "http://127.0.0.1:5501/Data.html" .This html page has 100*100 table row. I have react app hosted on http://localhost:5500/ in which i am displaying this html page.
htmlPage:
'<iframe width="100%" height="100%" scrolling="no" frameborder="no" allow="autoplay" src="http://127.0.0.1:5501/Data.html"></iframe>'
};
return (
<div className="App">
<Iframe iframe={demos["htmlPage"]} allow="autoplay" className="ifr1" sandbox="allow-scripts" />
{/* <div className="div1"></div> */}
{showModal === true ? <Example className="i am here" showModal={showModal} hideModal={hideModal} ch={ch} GD={GD} /> : <></>}
</div>
);
}
function Iframe(props) {
return (
<div className="ifram"
dangerouslySetInnerHTML={{ __html: props.iframe ? props.iframe : "" }}
/>
);
}
Data.html cross origin part:
function FunName(paramName) {
localStorage.setItem("chan", paramName);
window.postMessage(data2, "*");
}
its perfectly displaying Data.html page.Now i want to click on one of row in iframe and get id of td on iframe domain which is http://localhost:5500/ id domain is same i am getting the id using localStorage.But when domain is different i id is stored on http://127.0.0.1:5501 localstorage.but unable to get in localstorage of http://localhost:5500/ (react app) am unable to get id.i also try to use Postmessage method its also not displaying id.Kindly help me out to get the data from 127.0.0.1 html page localStorage to http://localhost:5500(React) localStorage.