Documentation / Tutorials / SPA

Event: Click - interact with server

/ SPA / Event: Click - interact with server

Click on the button will send the data to the server and update the element data with the recieved result.

  1. Front side button: (Click event)
    //** Attach N number of attributes **//
    route_ajax="[aw2.get module.slug /].whatever-template-name"
    class="btn btn-xs btn-primary"
    >Click Event</button>
  2. HTML element to show the server response:
    <div class='xyz-element'>Reply content will be placed here</div>
  3. Server side template where the posted data will be processed and result send back to server:
    [aw2.template whatever-template-name]
    //** Processing **//
    <template axn="selector.update" selector='.xyz-element' get='me.html'>
    This is the reply text recieved from the server
    [aw2.get request dump=true /]
Most Popular

Leave a Reply

Your email address will not be published.