User:Rexerexer/common.js

var articleTitle = $('#firstHeading').text; var articleUrl = window.location.href;

var titles = JSON.parse(sessionStorage.getItem('titles')) || [];

$('body').prepend(' '); for(var i=0; i'+t.title+' '); }

// Add logic for a queue implementation // Use a queue interface with array storage underneath // figure out logic for when to add versus when someone has gone back. var pageObj = Object.create(null); pageObj.title = articleTitle; pageObj.url = articleUrl; titles.push( pageObj );//TODO Will also probably need a url to store.

console.log('local storage array of page objects'); console.log(titles);

sessionStorage.setItem('titles', JSON.stringify(titles));