Sometime we have to fire a function or reload window only once.So I got a code from google to refresh page only once.Check Below:
//Check if the current URL contains '#'
// Set the URL to whatever it was plus "#".
url = document.URL+"#";
location = "#";
//Reload the page
In this script we will check if our page URL contains ‘#’ or not. If it isn’t then we will reload our page and include ‘#’ in the end of URL.After Doing this next time when our page will reload then it won’t refresh our page because this time our URL is containing ‘#’ and it will escape the refresh process.
Hope it will Help You and please subscribe me and like my facebook page :
and make me proud.By the way if you face any problem then let me know in comment section below