Preparing the initial view using JS