Mixing Javascript inside HTML -


there isa d3.js drawing function accepting element , d data params , inside function there html lines draw stuff:

'<p><strong>' + d.name_detail[0].detail_value + '</strong> ' + d.name_detail[1].detail_value + '<strong class="pharmacy-icon">' + d.generic_tooltip.length + '<img src="/assets/pill.png">' + '</img></strong></p>' + 

notice line '<img src="/assets/pill.png">' + need put logic in there example if d.showpill === true show pill icon otherwise don't show it. showing.

if inline:

((d.showpill == true) ? '<img src="/assets/pill.png"> : '') 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -