js part of saving a book works