WARNING: concrete5 5.6 and earlier are end-of-life. Sales from the marketplace have now ended. Click here to learn more about this transition.
Do not install this package on a real C5 site. Use it on a development site to help learn about AJAX.
This package is a learning experience, providing lesson examples of opening AJAX dialogs and exchanging AJAX data from a block, in Add, Edit and View. Examples are boiled down to a minimum to illustrate how they work (or dont).
Exchanging data between the browser and server using AJAX, or popping up a dialog using AJAX, from Concrete 5 is both straightforward and confusing. Straightforward because, once you boil it down to the basics, there is not much to it. Complicated because Concrete5 provides 3 slightly different ways of declaring AJAX action handlers. Which works best depends a lot on how you want to organise your package and in what context you want to use the AJAX transaction.
Rather than get bored and confused reading about all the various combinations and permutations, install this package on a development site and explore the behaviour of the blocks during Add, Edit and View:
AJAX is often combined with other JavaScript functionality, so in the dialog lessons we attempt to execute JavaScript from various places in various ways and using scripts declared in various sources, summarising success in a table.
See the documentation and dig into the source code for more details.
If you want to load blocks, stacks or page areas by AJAX, have a look at the Blocks by AJAX add-on.
See more addons by JohntheFish