
Django JavaScript Integration AJAX and jQuery : AJAX and JQuery.
Title:
Django JavaScript Integration AJAX and jQuery : AJAX and JQuery.
Author:
Hayward, Jonathan.
ISBN:
9781849510356
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (345 pages)
Contents:
Django JavaScript Integration: AJAX and jQuery -- Table of Contents -- Django JavaScript Integration: AJAX and jQuery -- Credits -- Foreword -- Web development that is more "Pythonic" than just Python -- Django and its templating engine -- What we will do in this book-building a Web 2.0 intranet employee photo directory -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Errata -- Piracy -- Questions -- 1. jQuery and Ajax Integration in Django -- Ajax and the XMLHttpRequest object -- Human speech: An overlaid function -- Ajax: Another overlaid function -- The technologies Ajax is overlaid on -- JavaScript -- XMLHttpRequest -- Methods -- Properties -- HTML/XHTML -- XML -- JSON -- CSS -- The DOM -- iframes and other Ajax variations -- JavaScript/Ajax Libraries -- Server-side technologies -- A look at Django -- Django templating kickstart -- A more complete glimpse at Django templating -- Setting JavaScript and other static content in place -- Summary -- 2. jQuery-the Most Common JavaScript Framework -- jQuery and basic Ajax -- jQuery Ajax facilities -- .ajax() -- context -- Closures -- Prototypes and prototypal inheritance -- data -- dataFilter -- dataType -- error(XMLHttpRequest, textStatus, errorThrown) -- success(data, textStatus, XMLHttpRequest) -- type -- url -- .aj0axSetup() -- Sample invocation -- .get() and .post() -- .load() -- Sample invocations -- jQuery as a virtual higher-level language -- The selectors -- A closure-based example to measure clock skew -- Case study: A more in-depth application -- Chapter 3: Validating Form Input on the Server Side.
Chapter 4: Server-side Database Search with Ajax -- Chapter 5: Signing Up and Logging into a Website Using Ajax -- Chapter 6: jQuery In-place Editing Using Ajax -- Chapter 7: Using jQuery UI Autocomplete in Django Templates -- Chapter 8: Django ModelForm: a CSS Makeover -- Chapter 9: Database and Search Handling -- Chapter 10: Tinkering Around: Bugfixes, Friendlier Password Input, and a Directory That Tells Local Time -- Chapter 11: Usability for Hackers -- Appendix: Debugging Hard JavaScript Bugs -- Summary -- 3. Validating Form Input on the Server Side -- The standard lecture: low-level validation -- Matching regular expressions -- You cannot guarantee absolutely valid data -- Validating can detect (some) malicious input -- The Django way of validation -- Django gives you some things for free -- The steps in Django's validation -- A more sensible and cruelty-free approach to validation -- Things get murkier -- The zero-one-infinity rule: a cardinal rule of thumb in usability -- An improvement on Django's advertised approach -- A validation example: GPS coordinates -- Avoiding error messages that point fingers and say, "You're wrong!" -- Validation as demanding that assumptions be met -- Old-school: conform to our U.S.-based assumptions! -- Adding the wrong kind of band-aid -- Making assumptions and demanding that users conform -- At least names are simple, right? -- Even in ASCII, things keep getting murkier -- Better validation may be less validation -- Caveat: English is something of a lingua franca -- We don't have to negotiate with pistols -- Doing our best to solve the wrong problem: a story -- It really does apply to validation -- Facebook and LinkedIn know something better -- Summary -- 4. Server-side Database Search with Ajax -- Searching on the client side and server side -- Handling databases through Django models.
Models for an intranet employee photo directory -- Searching our database -- A tour of Django persistence facilities -- Summary -- 5. Signing Up and Logging into a Website Using Ajax -- admin.py: administrative functions called once -- functions.py: project-specific functions, including our @ajax_login_required decorator -- views.py: functions that render web pages -- style.css: basic styling for usability -- search.html: a template for client-side Ajax -- The Django admin interface -- Summary -- 6. jQuery In-place Editing Using Ajax -- Including a plugin -- How to make pages more responsive -- A template handling the client-side requirements -- The bulk of the profile -- Whitespace and delivery -- Page-specific JavaScript -- Support on the server side -- Summary -- 7. Using jQuery UI Autocomplete in Django Templates -- Adding autocomplete: first attempt -- Progressive enhancement, a best practice -- A real-world workaround -- "Interest-based negotiation": a power tool for problem solving when plan A doesn't work -- A first workaround -- Boilerplate code from jQuery UI documentation -- Turning on Ajax behavior (or trying to) -- Code on the server side -- Refining our solution further -- Summary -- 8. Django ModelForm: a CSS Makeover -- "Hello, world!" in ModelForm -- Expanding and customizing the example -- Customizing ModelForm pages' appearance -- Going under ModelForm's hood -- An excellent "stupid" question: where's the e-mail slot? -- Summary -- 9. Database and Search Handling -- Moving forward to an AHAH solution -- Django templates for simple AHAH -- Templating for a list of search results -- Template for an individual profile -- Views on the server side -- Telling if the user is logged in -- A view to support deletion -- The AHAH view to load profiles -- Helper functions for the AHAH view for searching -- An updated model.
An AHAH server-side search function -- Handling the client-side: A template for the main page -- CSS for styling the directory -- Our updated urlpatterns -- Summary -- 10. Tinkering Around: Bugfixes, Friendlier Password Input, and a Directory That Tells Local Time -- Minor tweaks and bugfixes -- Setting a default name of "(Insert name here)" -- Eliminating Borg behavior -- Confusing jQuery's load() with html() -- Preventing display of deleted instances -- Adding a favicon.ico -- Handling password input in a slightly different way -- A directory that includes local timekeeping -- Summary -- 11. Usability for Hackers -- Usability begins with anthropology… and Django hackers have a good start on anthropology -- Anthropological usability techniques -- An introductory example: card sorting -- Focus groups: cargo cult research for usability -- Anthropological observation: the bedrock of usability -- More than one way to see the same situation -- Applying this foundation to usability -- It's just like (hard) debugging -- Lessons from other areas -- Live cross-cultural encounters -- History -- Old books and literature -- The last other area: whatever you have -- Understanding the user -- A lesson from optimization -- What's wrong with scratching an itch, or you are not your user -- Worst practices from the jargon file -- Python and usability -- It's not all about the computer! -- What to do in the concrete -- Further reading -- Summary -- A. Debugging Hard JavaScript Bugs -- "Just fiddling with Firebug" is considered harmful -- Cargo cult debugging at your fingertips -- The scientific method of debugging -- Exhausting yourself by barking up the wrong tree -- The humble debugger -- The value of taking a break -- Two major benefits to asking for help -- Firebug and Chrome developer tools -- The basics across browsers -- Zeroing in on Chrome -- Summary -- Index.
Abstract:
Develop AJAX applications using Django and jQuery.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Genre:
Electronic Access:
Click to View