Prototype – Cheat Sheet

I had to deal with Prototype while working with Magento. Here’s a little cheat sheet of some very simple stuff I had to do.

Make an Ajax Request with parameters

new Ajax.Request(url, {
                   params : { data1 : 'myParam' }
                   onSuccess: function(xhr){
                    var json = JSON.parse(transport.responseText);

Change value of an input

$('ID OF THE ELEMENT').setValue('The new value');

Change data within a span tag

$('ID OF THE ELEMENT').update('Your new data');


Django Cheat Sheet

Here are couple of useful commands / tutorials (in french sorry!) to get started easily with Django.

Create a project startproject <project_name>

Manually create a subfolder for HTML templates

Running servers

python runserver

Create an application (inside of a project)

python startapp blog


You should also read the Django course of Open Classrooms   to get started smoothly 🙂