0

Possible Duplicate:
how to refresh a page using javascript?

how to reload (refresh) the web-page through java script only once not repeatedly. I want to refresh the page once at a time.

Community
  • 1
  • 1
  • 3
    That's a very good question for [Google](https://encrypted.google.com/search?q=how+to+reload+page+using+javascrip). – Felix Kling Sep 28 '11 at 10:55
  • please guys read the question carefully and concentrate on "once and not repeatedly" word. ok? – Bhavik Shah Sep 28 '11 at 11:18
  • Then check this: http://stackoverflow.com/questions/6160415/reload-an-html-page-just-once-using-javascript – Felix Kling Sep 28 '11 at 11:20
  • It looks like nobody read the "once" - if you want that, use `if(location.search !== "?norefresh") location.href += "?norefresh"`. – pimvdb Sep 28 '11 at 11:20

5 Answers5

2

If you want to refresh (reload) the page you can use location.reload(true).
This link may help you to explore it further more Javascript Refresh Page

Naved
  • 4,020
  • 4
  • 31
  • 45
1

using history.go(0) refreshes the current page

KooiInc
  • 119,216
  • 31
  • 141
  • 177
  • this is not useful in my case it will refreshing every 1 seconds. I need only once. – Bhavik Shah Sep 28 '11 at 11:04
  • 1
    It will refresh only once. If your page refreshes multiple times, the cause must be elsewhere in your code. Review your question and give us some example code, i'd say. – KooiInc Sep 28 '11 at 11:08
0

location.reload( true );

The parameter tells the browser, to always reload the current page from the server. If that is skipped or explicitly set to false, the browser may load the page from its cache.

jAndy
  • 231,737
  • 57
  • 305
  • 359
0

Options :-

window.location.reload()
window.location.href=window.location.href
Jayendra
  • 52,349
  • 4
  • 80
  • 90
0

It will help you

window.location.reload(true);
Null Pointer
  • 9,089
  • 26
  • 73
  • 118