Skip to content

Instantly share code, notes, and snippets.

// visit: https://just-eat.dk/member/prevorders
// run it once per year
var siblings = $('#ctl00_ContentPlaceHolder1_rightbox a[href^="javascript:__doPostBack(\'ctl00$ContentPlaceHolder1$ctl00$ctl"').siblings(),
sum = isNaN(localStorage.getItem('JE')) ? 0 : parseInt(localStorage.getItem('JE'), 10),
yearSum = 0;
$('#ctl00_ContentPlaceHolder1_rightbox table tbody tr').each(function(){
var amount = parseInt($(this).find('td').eq(3).find('div').find('div').eq(0).text(), 10);
if (isNaN(amount)) return;
yearSum += amount;
});