Hello friends, welcome to my blog. Today I will show you how to call a function on page refresh using Javascript. This is a very vital script and save my life when I was working for a client. Client requirement was that when anyone navigate to another page of his website, audio player automatically pushed. So I use my logic and call a javascript function to pushed the audio on page refresh. By default audio player is on auto play mood. So when user goes to another page after page refresh the audio automatically start.

Below is the general coding. You can modify the code with your own logic and requirements.



So now you know how to call a function on page refresh using Javascript. You can use this coding to detect page refresh event in javascript or Call a function on page refresh or to check page is reloading or refreshing using jquery or javascript. If you find this article useful, do share it on Facebook and Google plus. If you have any questions regarding this article, feel free to ask via comment.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Call a function on page refresh using Javascript
Tagged on: