The call to load('/refresh')
replaces the contents of the responsecontainer
div with the loaded HTML.
To avoid duplicating that content in both templates, you could potentially make your main template include this sub-template inside the div, for example:{% for greeting in greetings %} {% if greeting.author %} <b>{{ greeting.author.nickname }}</b> wrote: <a href="/sign?key={{ greeting.key.id }}&auth={{ greeting.author.nickname }}">Delete</a> {% else %} An anonymous person wrote: {% endif %} <blockquote>{{ greeting.content|escape }}</blockquote> {% endfor %}
Best Answer<div id="responsecontainer"> {% include "sub_template.html" %} </div> <form action="/sign" method="post"> <div><textarea name="content" rows="3" cols="60"></textarea></div> <div><input type="submit" value="Sign Guestbook" name="submitGuestBk"></div> </form>
0 comments:
Post a Comment