在django模板中附加锚标记

时间:2017-08-22 02:42:21

标签: javascript jquery django

为了清晰起见进行编辑 - 这是html文件中的脚本标记

工作锚标签 -

      <a href="{% url 'comments:delete_question_comment' pk=comment.pk %}" title="delete" class="btn btn-simple">
        <span class="glyphicon glyphicon-remove text-danger"></span>
        <span class="text-danger icon-label">Delete</span>
      </a>

我试图追加 -

*dom node*.append("<a href='{% url \"comments:delete_question_comment\" pk=comment.pk %}'</a>")

错误 - 无法解析剩余部分:&#39; \&#34;评论:delete_question_comment \&#34;&#39;来自&#39; \&#34;评论:delete_question_comment \&#34;&#39;

我不确定出了什么问题。报价转义应该只是附加

\"comments:delete_question_comment\"

工作正常,所以如果有人知道问题是什么,我会非常感激

0 个答案:

没有答案
相关问题