Made a beginning for indexing pages with Javascript