This element:
<img id="img" src="{% static 'pd.jpg' %}" />
should go here:
popup.document.write("<img src={% static 'pd.jpg' %} />")
So think i need a third kind of quotation marks, or ?
popup.document.write(String(<img src="{% static 'pd.jpg' %}" />))
at least is not working.
So think I need a third kind of quotation marks, or ?
No: the template tags are resolved when the template is rendered. This is done by the server. JavaScript on the other hand will run by the browser, and after the template is rendered. You thus can make use of:
popup.document.write('<img src="{% static 'pd.jpg' %}" />')
The single quotation marks of the {% static 'pd.jpg' %} will thus not appear in the source of the page (which you can inspect in the browser).