Is it possible to pull in Previous & Next data using querySelector?

beendlox

New Member
Here is my code:\[code\]WinJS.xhr({ url: urlText }) .then(function complete(xml) { var restXML = xml.responseXML; var items = xml.responseXML.querySelectorAll("item"); for (var i = 0 ; i < items.length ; i++) { var item = items; title = items.querySelector("title").textContent; dataList.push({ title: title });\[/code\]What I am trying to do is get the previous and next titles in the same dataList.push. Is this even possible?Also, how would I stop it from producing an error on the first title as that has no previous entry?Thanks for reading my question.
 
Top