I'm having a problem relating to storing a variable within Javascript. I have a web monitoring page (I have written the code which works), which refreshes automatically every 5 mins.
If one of the sites I am monitoring goes down, the JS sends an email to the admin, but I only want to send this once.
My logic was to:
Check if a site is down if variable emailPreviouslySent == 'no' then send email to admin write to variable emailPreviouslySent = 'yes'
Page would refresh
Check if a site is down emailPreviouslySent == 'yes'
email would not be sent again
However I'm finding that the variable is emptied each time the page refreshes.
Is there a way of carrying the variable even though the page is refreshing, or perhaps another way around this?
Thanks for your help.