Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
How to share data between cross origin local Storage from html to react iFrame?

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!