ajax in django
TRANSCRIPT
So who's this dude?
Art(h)urWorking at Tesco Diets Taming the unruly browsers(more often the other way round)
http://slideshare.net/cistov
Not a 'howto' talk
So, Ajax...
Clearly the most overhyped cleaning liquid ever
Say Ajax again!
Widely adopted
Ajax in broad sense
DRY
Django Goals
1.Make web development stupidly fast
2. Automate the repetitive stuff
3. Practice loose coupling
4. Follow best practices
5. Be efficient
Pinax as 'Django with bigger opinion'
But...
'Django often gets marked down in a "framework comparisons" due to the lack of built in Ajax support. Personally I think that not shipping with a single library is a feature, not a bug.'
Simon Willison
Giants & their shoulders
Fred
Exhibit A: ASP.NET UpdatePanel
Concerns:
Multiple scriptsFilesizePerformanceGenerated MarkupAccessbilitySEOTied to specific libraryExtension of builtin types
Exhibit B: Rails helpers
Concerns:
Generated MarkupAccessbilitySEOTied to specific libraryExtension of builtin types
Exhibit C: Cappucino/GWT
Concerns:
AccessbilitySEO
If you have two separate versions, this approach
may make sense
Chances are, you're not building GMail though
http://leandrovieira.com/projects/jquery/lightbox/
Should I even be bothered?
iPhone supports JavaScript
Ok, slow JavaScript, but still?
¿Habla HTML?
<rant>
</rant>
“Just as easy as not to”
3
Hooks
Clean HTML
Libraryagnostic
Loose coupling
Drivers
Caching
Even backend agnostic
Artur, this is all great, but Ruby meet up is next
month
Meet 40 lines of messy code
HttpRequest.is_ajax()is your friend
Poor man's singlepaged applications
Dependencies
Providing configuration data on page load
CSS classes?
Custom attributes?
data* hell?
Inline objects?
Unit Testing
Extending functionality
Callbacks?
Custom events?
Inheritance?
Data Access?
XSS/XSRF & JSON APIs
GWT Query
Future?
Image Credits
http://www.flickr.com/photos/atauri/2358057325/http://www.flickr.com/photos/jeffmcneill/4169128852/http://www.flickr.com/photos/seandreilinger/3650862305/http://www.flickr.com/photos/lrargerich/2800244229/http://www.flickr.com/photos/mager/2803365394/http://www.flickr.com/photos/joyoflife/317125573/http://www.flickr.com/photos/young_einstein/74097753/http://www.flickr.com/photos/drewm/4749504388/
Questions?
http://www.twitter.com/cistovhttp://www.slideshare.net/cistov