initialize canvas using javascript