LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-12-2009, 11:38 AM   #1
supertramp
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
Firefox Specific Refresh Problem. Ffox Can't remember redirected URL after ajax call


Hi.
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').

Problem:
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.

Some workarounds:
** 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)?
Incompatible code?
I miss something??

Please help.
 
Old 07-13-2009, 08:07 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,150

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Have you verified the problem in FF 3.5? (3.0.4 is a fairly old release.) I'd try it myself, but I don't run any servers on my laptop.
 
Old 07-20-2009, 07:33 AM   #3
supertramp
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by PTrenholme View Post
Have you verified the problem in FF 3.5? (3.0.4 is a fairly old release.) I'd try it myself, but I don't run any servers on my laptop.
I have limited Net connection so I didn't try FF 3.5 . I will report as soon as I update my system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force specific refresh for specific resolution miner49er Linux - General 2 03-20-2009 02:36 AM
firefox issue; google redirected to kpn hotspots after visiting the site at hotspot schatoor General 3 08-07-2007 08:24 AM
Ajax - Need Help to Automatically Refresh Comments farmerjoe Programming 1 07-11-2007 11:52 PM
Specific Monitor Refresh Rates in Redhat? dbeatle123 Linux - Hardware 3 01-13-2005 11:22 AM
Browser gets redirected at first page loaded - very annoying - why? (firefox-0.9.1... jomen Linux - General 9 08-06-2004 05:59 AM


All times are GMT -5. The time now is 05:20 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration