js: store pages in an array
fix js