Help: reloading a page via ajax - when window.location=self.location doesn't work?

Window. Location = self. Location This javascript is executing When it executes, the browser is being told to replace value of window.

Location with a new value Not all browsers will react the same way here.. Some will probably work as you expect, but others will get smart about it and compare the two values The browser knows what page it's on, and it knows that you're just asking for it to go to the same page Browser Cache The browser even has a copy of your current page in cache It can talk to the server and ask whether the page it has in cache is still valid. If the cache is valid, it may decide not to force a reload of the page. Behind the scenes, this happens with HTTP Headers.

Browsers and servers can communicate over HTTP in many ways. In this case, your browser sends a quick request to the server saying something like this: GET /stackoverflow. Com/posts/196643/index.

Html HTTP/1.1 Host: www.stackoverflow.com User-Agent: Mozilla/5.0 If-Modified-Since: Sun, 12 Oct 2008 20:41:31 GMT This is called a conditional GET request By saying If-Modified-Since your browser is saying, "Give me that file, but only if it has been modified since the last time I saw it Long story short, you haven't explicitly told the browser to reload the page Here's how you can: location. Reload( true ) The "true" is an optional parameter for forcing a reload The browser won't even look at the cache.. It will just do as you say.

Window. Location = self. Location; This javascript is executing.

When it executes, the browser is being told to replace value of window. Location with a new value. Not all browsers will react the same way here.. Some will probably work as you expect, but others will get smart about it and compare the two values.

The browser knows what page it's on, and it knows that you're just asking for it to go to the same page. Browser Cache The browser even has a copy of your current page in cache. It can talk to the server and ask whether the page it has in cache is still valid.

If the cache is valid, it may decide not to force a reload of the page. Behind the scenes, this happens with HTTP Headers. Browsers and servers can communicate over HTTP in many ways.In this case, your browser sends a quick request to the server saying something like this: GET /stackoverflow.

Com/posts/196643/index. Html HTTP/1.1 Host: www.stackoverflow.com User-Agent: Mozilla/5.0 If-Modified-Since: Sun, 12 Oct 2008 20:41:31 GMT This is called a conditional GET request.By saying If-Modified-Since, your browser is saying, "Give me that file, but only if it has been modified since the last time I saw it. " Long story short, you haven't explicitly told the browser to reload the page.

Here's how you can: location. Reload( true ); The "true" is an optional parameter, for forcing a reload. The browser won't even look at the cache.. It will just do as you say.

Wow a JS guru, thanks a lot for this I owe you a donut and some coffee :) – lock Oct 13 '08 at 3:38.

Going to an anchor on a page -- which is what # signifies -- does not require a reload.

I am aware that anchors will not reload the page but still, after the Ajax class evaluates the script and reads a window. Location = self. Location will it still not execute that?

If they click the link the self. Location will contain a # as well, thus there will be no reload. – Robert K Oct 8 '08 at 2:48.

If they handed me this particular task at work I'd kick it back to design. Unless we're talking about a secure page, or an OpenID login, you should not pop up a log-in or sign-in form. Users need to learn to look for that https: at the top of their page, and never .

This javascript is executing. When it executes, the browser is being told to replace value of window. Location with a new value.

Not all browsers will react the same way here.. Some will probably work as you expect, but others will get smart about it and compare the two values. The browser knows what page it's on, and it knows that you're just asking for it to go to the same page. The browser even has a copy of your current page in cache.

It can talk to the server and ask whether the page it has in cache is still valid. If the cache is valid, it may decide not to force a reload of the page. Behind the scenes, this happens with HTTP Headers.

Browsers and servers can communicate over HTTP in many ways. This is called a conditional GET request. By saying If-Modified-Since, your browser is saying, "Give me that file, but only if it has been modified since the last time I saw it."

Long story short, you haven't explicitly told the browser to reload the page. The "true" is an optional parameter, for forcing a reload. The browser won't even look at the cache.. It will just do as you say.

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