Added JavaScript sample code