Adding javascript to populate index page