Search code examples
javascriptjqueryhtmlfunctionmeta

Javascript page reload or Meta Tag refresh method?


I looking to add a script to my aspx page that will refresh/reload the page every 15secs. There is dynamic data on my page that is sourced from Oracle. I found that I can use Javascript "reload" or the Meta Tag method, which is the best method to use to refresh a page with dynamic data?

Thanks alot!


Solution

  • You can use

    <meta http-equiv="refresh" content="15"> 
    

    but it has also drawbacks. For example if the user load the next page before 15 sec. You may get some anexpected browser reloads

    using javascript you may do something like

    window.setTimeout(function(){window.location.href=window.location.href},15000);