Reload an HTML page just once using JavaScript?

You could use a querystring at the end of the page url (e.g.? r), and check for it before redirecting, as if it exists, the redirect is already done.

Up vote -2 down vote favorite share g+ share fb share tw.

I am using history. Go(0); with function onLoad in body tag but I want to run it only once. Please keep in mind that I am using iframe so this is not possible to to use the below types code: the above code not worked for me but the below code is work good but the problem is that I need it to loads once note: I am using 2 iframes when user click on main page link a page loads in iframe than I want to reload the whole page with current iframe page.

Javascript html iframe javascript-events link|improve this question edited May 28 '11 at 8:36beardtwizzle2,7712828 asked May 28 '11 at 7:55Danish61.

1 Why the BOLD TAGS, the nineties are long gone – Ibu May 28 '11 at 7:57 you are tryin to reload everytime it loads, why are you trying to reload in the first way, maybe there is better alternative – Ibu May 28 '11 at 7:58 2 This doesn't make any sense whatsoever, as soon as the page loads, it would reload and be a new page so it would reload again (for the first time for that load). I guess you are trying to get the browser to show the most recent content, that is done with cache control. – Quentin May 28 '11 at 7:58 Can you explain why do you need to do that, so that our suggestions will be more in-context?

– sergio May 28 '11 at 8:01 @lbu @Quentin read my question I need it loads once because I am using iframe when user click on link it loads a iframe than I want to load the whole with the same which he opens recently – Danish May 28 '11 at 8:01.

You could use a querystring at the end of the page url (e.g.? r), and check for it before redirecting, as if it exists, the redirect is already done. If(window.location.href. Substr(-2)!

== "? R") { window. Location = window.location.

Href + "? R"; } Disclaimer: I agree with others that you probably have a better solution - and should never need to refresh 'just once'. Explanation of use At the bottom of your page, just above the you should put this:- That's it.

Sorry is not a good answer, only post when you are not sorry – Ibu May 28 '11 at 8:02 I am not to good in html and javascript I understand what you try to teach me but I am unable to do this. – Danish May 28 '11 at 8:09 @Ibu, @Danish - updated to clarify. – beardtwizzle May 28 '11 at 8:09 @lbu still did not get it because I am not to good in javascript please explain it more where to use and what can I have to do – Danish May 28 '11 at 8:14 @Danish - updated for you – beardtwizzle May 28 '11 at 8:18.

The only way I can think of to do this is by using cookies (or if your on the right platform, sessions) and flag the first time it has reloaded, variables might also work in this case, because we're speaking about IFRAME, but I have never tried such thing.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions