JS functionality for adding new page.