Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
  <script > var pt = string.concat({{ research.Country_ID}},{{ research.Stock_ID}});
              var ptYear =string.concat(pt,YEAR.png);
              var ptQuarter=string.concat(pt,QUARTER.png);
              var pt5Year=string.concat(pt,5YEAR.png);
              var ptMonth=string.concat(pt,MONTH.png);
     <img src="{% static 'ptYear' %}" alt="For image run1" width="500" height="600" > 
      <img src="{% static 'ptQuarter' %}"  alt="For image run2" width="400" height="600">
     <img src="{% static 'pt5Year' %}" alt="For image run3" width="400" height="600">

What I have tried:

In above trying to pass variable that keep changing on run time.. tried to concat and pass throgh variable...
Richard MacCutchan 26-Jun-20 11:52am
Where, what, how?
Member 3564076 26-Jun-20 12:28pm
Hi Richard, In img SRC= trying to create path by variables through concat it. First created those variables and trying to pass in img src=.

Here <img src="{% static %}"> is well tested path of project root and after then trying to add image dir... Can you help me on this.
Richard MacCutchan 26-Jun-20 12:35pm
Sorry, but your comments are not clear. But why are you using static values if you want to make dynamic changes?
Member 3564076 26-Jun-20 13:20pm
static is a dir where all images got created by diff process and it is a subdir after project root dir, now trying to pick those image name from different process by identifying their names and names created by different events ,so it should pick right image dynamically by concating on run time. hope this clear the flow, now issue is how to pass those names in img src=< ??? >.
Richard MacCutchan 27-Jun-20 4:10am
You just need a Javascript function that builds the link addresses and adds theminto the document at the correct position. You can then call that automatically by one of the browser events. See JavaScript Events[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100