I couldn't get worked following script with firefox 3.0.4 as I expect.
(With ie and konqueror it works as expected but not with firefox.)
Code (test.php): http://paste-it.net/public/u76374a/
This code serves ajax response if $_GET['ajax'] is set, and serves whole html page if $_GET['ajax'] not set.
Goal of code:
if user makes a page request or hits refresh button after an ajax call, redirection to same page must be occured with some $_GET values (for example: 'test.php?redirected=true').
test.php does the goal said above - no problem.
For example if user makes a page request after an ajax call redirection occurs.
Or if user hits refresh button after an ajax call redirection occurs.
But problem comes with second refresh. if refresh button clicked second time, firefox goes to the URL which was in URL bar before the redirection occured.
Demonstration of problem:
1- On firefox, load url 'localhost/test.php'.
2- To make an ajax call click on 'will be changed?' text. After click, text must be turned to "yes, changed". That was an ajax call to test.php.
3- Hit refresh button. Because of refresh is after an ajax call, redirection occurs to 'test.php?redirection=true'.
-- So far so good. I want exactly this behaviour --
4- (Problem starts) If refresh button clicked second time firefox goes to last URL entered before redirection ('localhost/test.php'), not to 'test.php?redirection=true'. In other words, firefox doesn't behave redirected URL (which occured after an ajax call) like current URL in URL bar. It behaves like last URL entered by hand is still in URL bar, supposing that redirection never happened.
** On first step of demo; if url 'localhost/test.php?some_variable=some_value' was loaded, on step 4 firefox goes to 'localhost/test.php?some_variable=some_value'. So I said "...firefox goes to last URL entered by hand before redirection..."
** On step 4; if I press Enter when cursor is in URL bar (Instead of clicking refresh button), firefox goes the URL 'test.php?redirection=true'. So, no problem with 'test.php?redirection=true' URL. So I said "...firefox doesn't behave redirected URL, which occured after an ajax call, like current URL in URL bar..."
Bug in firefox?
Bug in script (test.php)?
I miss something??