itemsPerPage = 10; curPos = 0; function browseXML() { resultSetLength = $("session",xmlDataSet).length; strToAppend = "

"; if (curPos + itemsPerPage > resultSetLength) { showingThrough = resultSetLength; } else { showingThrough = parseInt(curPos + itemsPerPage); } strToAppend += "Showing " + parseInt(curPos + 1) + " through " + showingThrough + " of " + resultSetLength + ""; strToAppend += "

"; // if (itemsPerPage > resultSetLength ) { // strToAppend += ""; // } if (itemsPerPage < resultSetLength) { if (curPos == 0) // First page. Go forward only. { strToAppend += "
Next Items » 
"; } // if (itemsPerPage > resultSetLength) // One page only // { // strToAppend += "
« Previous Items"; // strToAppend += "  |  "; // strToAppend += "Next Items » 
"; // } if (curPos > 0 && parseInt(curPos + itemsPerPage) < resultSetLength) // Somewhere inbetween. { strToAppend += "
« Previous Items"; strToAppend += "  |  "; strToAppend += "Next Items » 
"; } if (parseInt(curPos + itemsPerPage) >= resultSetLength) // Last page. Go back only. { strToAppend += "« Previous Items "; } } strToAppend += "

"; $("session:lt(" + parseInt(curPos + itemsPerPage) + ")",xmlDataSet).filter(":gt(" + parseInt(curPos - 1) + ")").each(function(i) { var id = $(this).find('sessionid').text() var name = $(this).find('sessionName').text() var chair = $(this).find('sessionChair').text() var venue = $(this).find('venueName').text() var title = $(this).find('eventAttribute:eq(0)').text() var description = $(this).find('eventAttribute:eq(1)').text() var category = $(this).find('eventAttribute:eq(2)').text() var authoraffil = $(this).find('eventAttribute:eq(3)').text() var start = $(this).find('sessionStartTime').text() var end = $(this).find('sessionEndTime').text() var startnew = Date.parse(start).toString('dddd, d MMMM | h:mm tt'); var endnew = Date.parse(end).format('h:mm tt'); // var startnew = Date.parse(start).format('%A, %e %B | g:%M a'); // var endnew = Date.parse(end).format('g:%M a'); strToAppend += "

" + name + "

" + category + " | " + startnew + " - " + endnew + " | " + venue + "

"; }); $("#content-update").html(strToAppend); }