{live} makes part of a page interactive without JavaScript of your own. A click on
an element with pad-click inside the region posts the event to the page; the page
runs again on the server, and only the region comes back and is swapped in.
|
PHP fragments/live_1.php |
HTML fragments/live_1.pad |
Result |
|---|---|---|
|
|
Clicked 0 times |
pad-click="add" on any element, pad-submit="save" on a form (its
fields come along as ordinary request values), pad-change="pick" on a field
(its name and value come along); pad-value adds a value to the event.padLiveEvent() and its value with
padLiveValue(); both are empty on an ordinary request.$padSessionVars), or in a database.<div data-pad-live="name">; the first region of a page
brings the small script that does the posting and swapping.