javascript sample code