Fixed javascript to load data using javascript array.