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

223
Views
React - Calling a function from content management system html

I have an odd case that I need to solve. I have a react app that dynamically injects html content via (dangerouslySetInnerHTML={{__html: data}}). Think of it as a pseudo content management system with some legacy html content with some embedded javascript method calls, so I can't change the follling html block.

Example embedded html block (injected using dangerouslySetInnerHTML):

<p><a href="javascript:showvideo('http://urldir/vid.mp4',vwidth,vheight,0)">Launch vid.</a></p>

in my react component:

function showvideo(url,width,height,id){
  console.log('called showvideo')
}

I keep getting 'Uncaught ReferenceError: showvideo is not defined'

How do I call a function with <a href='javascript:myfunction'> in react?

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!