// function reloadFromServer() {
// 	location.reload(true); //“true” parameter to reload from server, not cache
// }

//on page load
if (typeof(Storage) !== "undefined") { // check browser support for localStorage

	// Code for localStorage/sessionStorage.
	if (localStorage.jlLastLoadedDate) {

		var jlLastLoadedDate = new Date(localStorage.jlLastLoadedDate);
		var currentDate = new Date();

		// if jlLastLoadedDate is different from currentDate
		if (jlLastLoadedDate.getFullYear() != currentDate.getFullYear() ||
			jlLastLoadedDate.getMonth() != currentDate.getMonth() ||
			jlLastLoadedDate.getDate() != currentDate.getDate()) {

			// replace localStorage.jlLastLoadedDate with current date
			localStorage.jlLastLoadedDate = new Date();

			// reload current document (does the same as the reload button in the browser), delayed to give service worker time
			// setTimeout(reloadFromServer, 200);
			location.reload(true); //“true” parameter to reload from server, not cache
			//window.location.href = window.location.href.split( '#' )[0];
		}
	}
	else {
		// initialize localStorage.jlLastLoadedDate with current date
		localStorage.jlLastLoadedDate = new Date();
	}
}
