After checking out this query that was posted earlier, I am interested in implementing a similar feature using AJAX to load the comment box without having to refresh the entire page. My platform of choice is Google App Engine with Python as the primary language. How can I adapt the code provided in the original question to suit my needs and incorporate the use of AJAX? Here's an overview of how I am currently populating:
{% extends "_base.htm" %}
{% block bodycontent %}
<h1>App Engine Chat</h1>
<p>
<form method="post" action="/chat">
<input type="text" name="message" size="60"/>
<input type="submit" name="Chat"/>
</form>
</p>
{% ifnotequal error None %}
<p>
{{ error }}
</p>
{% endifnotequal %}
<div id="chatcontent">
Loading...
</div>
<script>
function updateMsg() {
$.ajax({
url: "/messages",
cache: false,
success: function(html){
$("#chatcontent").html(html);
}
});
setTimeout('updateMsg()', 4000);
}
updateMsg();
</script>
{% endblock %}
In addition, I would like to only display the latest 10 comments and hide the remaining messages. Thank you for your assistance...