Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How a React function output can be added in a embed-HTML link

Sorry if it is a dummy question.

I am trying to make a react website

I have a React function;

{this.state.graphNumber} 

which returns a number of index of graphs. Please see the link below. e.g function returns 111

Update: Sorry it is a embed HTML-Link not a URL link

I need to add that number into a embed html-link for showing correct graph.

<iframe width="100%" height="100%" frameborder="0" scrolling="no" "src=//plot.ly/~username/111.embed?showlink=false&modebar=false&autosize=true" ></iframe>

I search the internet but I could not figure out.

Thank you for advance

like image 915
macintosh Avatar asked Dec 20 '25 21:12

macintosh


1 Answers

If I understand you well, you want a dynamic URL. For that you can try something like that:

<iframe width="100%" height="100%"  src={`//.url-is-here/${this.state.GraphNumber}`}></iframe>

Edit: Add brackets around dynamic url, thanks to @DTul comment below.

like image 103
Arnaud Christ Avatar answered Dec 23 '25 10:12

Arnaud Christ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!