pyblosxom ajax comments ![ajax](/space/ajax.jpg) _This patch was applied to the Pyblosxom contributed plugins pack in [revision 973](http://pyblosxom.svn.sourceforge.net/viewvc/pyblosxom?view=rev&revision=973). It's included in [version 1.3.3](http://sourceforge.net/project/showfiles.php?group_id=67445&package_id=145140&release_id=489295) of the contrib pack._ For the impatient:   [Download contrib pack 1.3.3](http://sourceforge.net/project/showfiles.php?group_id=67445&package_id=145140&release_id=489295) (includes AJAX support)   [PyBlosxom home page](http://pyblosxom.sf.net/)   [PyBlosxom plugin registry](http://pyblosxom.sf.net/blog/registry?sortby=path) [PyBlosxom](http://pyblosxom.sf.net/), the server software that runs this site, uses a [plugin](http://pyblosxom.sourceforge.net/blog/registry/input/comments) to handle commenting. This patch adds [AJAX](http://en.wikipedia.org/wiki/Ajax_\(programming\)) support to that plugin. [Try it!](/space/pyblosxom+ajax+comments#comment-anchor) Specifically, comment previewing and posting can optionally use AJAX, as opposed to full HTTP POST requests. This avoids a full-size roundtrip and re-render, so commenting feels faster and more lightweight. To enable AJAX comments, set the `comment_ajax` config parameter in `config.py` to True. AJAX commenting degrades gracefully in older browsers. If JavaScript is disabled or not supported in the user's browser, or if it doesn't support `XmlHttpRequest`, comment posting and preview will use normal HTTP POST. Feel free to [check out the JavaScript](/comments.js). Also, since the browser window never sends a full POST request, refreshing the page after a preview or comment submission won't re-post the comment, or pop up an annoying "are you sure?" dialog box. AJAX comment support requires a few elements in the comment-form flavour template. Specifically, the comment-anchor tag must be the first thing in the template: Also, the buttons in the comment form should include these onsubmit and onclick attributes:
Finally, this script tag must be included somewhere after the `
` tag: All of these tags are included in the default comment-form template that comes with this plugin. AJAX comment support is copyright 2006 [Ryan Barrett](/space/about), and is distributed under the [GPL](http://www.gnu.org/licenses/gpl.html). Thanks to [Todd Warner](http://www.dma.org/cgi-bin/cgiwrap/tw/toddblog) and [Blake Winton](http://bwinton.latte.ca/) for beta testing and improvements. See also: * [migrating to pyblosxom](/space/2006-08-23) * [filekicker](/space/filekicker) * [photogallery](/space/photogallery) * [hardcodedates](/space/hardcodedates) * [pyblosxom rdf flavour](/space/pyblosxom rdf flavour)