I am making an ajax call via jQuery and I am trying to style and inject the data back to the DOM.
If I have a django condition in my javascript variable, how can I revert it back into the DOM where django can still process it.
Example of Javascript
var injecthtml =
'<a href="{% if user.is_authenticated %}'+datainfo.id+'{% else %}/register/{% endif %}"';
$("#somediv").html(injecthtml);
After doing this and when I go back to check the DOM the {% if user.is_authenticated %} is visible when I inspect my "a" tag.
Any idea on how this can be done?