Blog / Javascript

Display a message to your users while waiting for a file download with jQuery File Download

November 6, 2016

jQuery Filedownload EZ Exporter Shopify App

Our Shopify app, EZ Exporter, provides an option for users to download reports on demand from the app's main page. Since it could take some time to generate the report in the background depending on the data, we needed a way to let the user know that the task is currently in progress so they don't reload the page or do something else thinking that nothing is happening. We also wanted to block the …

Adding responsive tables (no scrollbars) to your Django app with DataTables

January 13, 2015

It had been over year since I last looked at DataTables, a jQuery table plugin for creating tables with advanced features. I used it for my Django app, GlucoseTracker, and it worked great. But one thing that was bothering me was it wasn't responsive. It was the only element in my app that wasn't responsive and looked horrible when viewing on a phone in portrait mode.

Over the weekend I decided to check …

Adding drag and drop image uploads to your Django site in 5 minutes with DropzoneJS

November 28, 2014

I've been using the Django admin to upload images to my site one-by-one for a few weeks now and I've finally decided I've had enough of it and started looking for a Javascript library that will enable me to do bulk uploads.

I still have around 100 or so albums and at least 1,000 more pictures to upload so you can just imagine how tedious that would be. I found this library called DropzoneJS that …

Using Highcharts with Django 1.6 and Bootstrap 3

December 13, 2013

I was looking for a library to create charts to use for my Django app about a week ago and a friend suggested to try Highcharts as he had heard good things about it from fellow Python/Django developers.

Highcharts is a charting library purely written in JavaScript. The charts look really pretty and interactive. Using the library is quite easy, too, thanks to the well written documentation with lots of examples. You can view a …

How to submit a form in a POST request using JavaScript

April 16, 2013

I was working on a Django project a couple of days ago where I needed to use JavaScript to submit a form in a POST request. The response of this request is a PDF file generated with ReportLab. I wanted the browser to prompt the user to download the file or open it in the browser in another window.

I was trying to do this with AJAX at first, but apparently you’re not really supposed …