Chapter 4. Templates and JavaScript

In this chapter, we will cover the following topics:

  • Arranging the base.html template
  • Including JavaScript settings
  • Using HTML5 data attributes
  • Opening object details in a modal dialog
  • Implementing a continuous scroll
  • Implementing the Like widget
  • Uploading images by Ajax

Introduction

We are living in the Web2.0 world, where social web applications and smart websites communicate between servers and clients using Ajax, refreshing whole pages only when the context changes. In this chapter, you will learn best practices to deal with JavaScript in your templates in order to create a rich user experience. For responsive layouts, we will use the Bootstrap 3 frontend framework. For productive scripting, we will use the jQuery ...

Get Web Development with Django Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.