Some questions and answers that got raised with my recent post on Seaside Ajaxification:
- Is this in use and tested?
- Yes. I’ve written several industrial applications that use this trick to some extent for many years already. The code given in the blog post has been simplified to demonstrate the idea. Depending on the context used, it will certainly be required to consider additional things such as HTML forms or the back button.
- Does it work with Seaside 2.8 and 3.0?
- The trick does not depend on the web framework. In fact, it is possible to plug it into any web-application or web-site as it is.
- Do I have to change my application when using the script?
- No. When using the script you don’t have to think about AJAX at all. You write a traditional web application and it gets AJAX enabled simply by adding the script. There is no need to change existing code.
- If an application has a large amount of almost-full-page AJAX re-draws, will the use of the script make this simpler?
- Yes, the script centralizes and automatizes these re-draws.
- Do I have to remove manually crafted Ajax actions?
- No, the script assigns a click handler to the body of the document only. This means it is only triggered when the user clicks on a traditional link. Other click handlers in the document continue to work as is.
- That back button comment sounds just too intriguing. Is it really that easy?
- The idea is to put the
_kpart of the Seaside URL into the fragment of the URL.
- Is there any way to force some actions to actually do a traditional full-page refresh?
- Yes, by assigning an URL to
window.location, or by changing the script to ignore certain anchors.
- Will this cause callbacks to continuously accumulate on the server side until an actual full-page refresh?
- No. To Seaside the AJAX requests look like normal full-page requests. Therefore Seaside behaves and caches the callbacks as it does with a traditional application.
- Any plans to include any of these into Seaside 3.0 as some kind of extension package?
- Yes, an improved implementation is part of the
JQuery-Corepackage in Seaside 3.0. Just add the libraries
JQAjaxifierLibraryto give it a try.