HOWTO's and Patterns for Play Framework and other fun technologies.
localhost9000.com
Using the app/view/_partial naming convention to dynamic sub-content AJAX loading
Minimum Viable Example
2013-Jun-30 Taylor Brockman
Sequence Steps:
- Browser requests main page: /index via GET
- Page defines a submit button plus empty div#searchResults landing zone
- JQuery custom script click event handler on user input control (button).
- Ajax anonymous function {1} triggers on input 'click' handler.
- Html writer anonymous function {2} triggers on ajax 'done' handler.
- Browser writes results of Browser writes results of _searchResults.html.scala into results landing zone div.
- Click button again to repeat. Add text input box for more fun.
Gist Source Example:
Screenshots:
Screenshot 1: Initial Page Load to /index
Screenshot 2: Page state after the AJAX request to _searchResults
Copyright © 2013 Taylor Brockman