Sample code for javascript