CartoDB offers a simple unified JavaScript library called CartoDB.js that let you interact with the CartoDB service.
To start using CartoDB.js just paste this piece of code within the HEAD tags of your HTML:
Create a map and add a CartoDB layer: