updates javascript layout