`); let searchUrl = `/search/`; history.forEach((elem) => { prevsearch.find('#prevsearch-options').append(`
${elem}
`); }); } $('#search-pretype-options').empty(); $('#search-pretype-options').append(prevsearch); let prevbooks = $(false); [ {title:"Recently Opened Textbooks", books:previous_books}, {title:"Recommended Textbooks", books:recommended_books} ].forEach((book_segment) => { if (Array.isArray(book_segment.books) && book_segment.books.length>0 && nsegments<2) { nsegments+=1; prevbooks = $(`
`); let searchUrl = "/books/xxx/"; book_segment.books.forEach((elem) => { prevbooks.find('#prevbooks-options'+nsegments.toString()).append(`
${elem.title} ${ordinal(elem.edition)} ${elem.author}
`); }); } $('#search-pretype-options').append(prevbooks); }); } function anon_pretype() { let prebooks = null; try { prebooks = JSON.parse(localStorage.getItem('PRETYPE_BOOKS_ANON')); }catch(e) {} if ('previous_books' in prebooks && 'recommended_books' in prebooks) { previous_books = prebooks.previous_books; recommended_books = prebooks.recommended_books; if (typeof PREVBOOKS !