Manipulating the browser history [HTML5]

Since the introduction of HTML5 it’s been possible to manage the browser history using the history and history.pushState API. It allows us to change the URL in the browser without the page refreshing. There are a lot of frameworks that already support the history and pushState API such as Backbone.js, Ember.js and Angular.js.

In this post, we’ll be looking at using the Browser push state without resorting to any framework. To do this we first need to have a way to check if the user has access to the history API.

Read More (External)

Custom code editor in Django admin

Example in this post will demonstrate how to add CodeMirror, a text editor implemented in Javascript, to the Django Textarea form widget by extending the class django.forms.Textarea. Modified widget will be used as an example in Django Admin, but it can be easily ported to any Django form. CodeMirror editor implemented below is set to a HTML/Javascript mode. To support other languages/modes check the CodeMirror documentation.

Read More

Implement cookies disclaimer in Javascript

It is now a legal requirement in Europe to notify the users when a website is using cookies to store information, a lot of websites started integrating a small disclaimer, we will be discussing a simple integration which allows the users to dismiss the given disclaimer and only see it once.

Ironically enough this task can be easily accomplished by using nothing else than cookies. Cookies can be created, updated or deleted either by backend or frontend. In this tutorial we will be covering a sim

Read More (External)