Changes between Version 113 and Version 114 of GenshiTutorial
- Timestamp:
- Aug 10, 2008, 3:05:41 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiTutorial
v113 v114 1126 1126 To demonstrate how you'd use Genshi in a project that uses AJAX, let's enhance the Geddit commenting feature to use AJAX. We'll implement this in such a way that the current way comments work remains available, to serve those who don't have Javascript available, and also just to be good web citizens. That approach to using funky new techniques is often referred to as “unobtrusive Javascript”, and what it provides is “graceful degradation.” 1127 1127 1128 '''Note''': technically, what we'll be doing here isn't AJAX in the literal sense, because we'll not be ingtransmitting XML. Instead, we'll respond with simple HTML fragments, a technique that is sometimes referred to as “AJAH” (“H” as in HTML).1128 '''Note''': technically, what we'll be doing here isn't AJAX in the literal sense, because we'll not be transmitting XML. Instead, we'll respond with simple HTML fragments, a technique that is sometimes referred to as “AJAH” (“H” as in HTML). 1129 1129 1130 1130 We'll go about this in the following way: on a link submission detail page, the “Add comment” button will now load the comment form into the current page, instead of going to the dedicated comment submission page. When the user clicks the “Cancel” button, we simply remove the form from the page. On the other hand, if the user clicks the ”Submit” button, we validate the entry, and if it's okay, we remove the form and load the new comment into the list on the page. That means that the user never leaves or reloads the link submission detail page in the process!