0

Is there any way to avoid firefox and IE to reload the page adding the hash-tag to the url.

Due to that I have to refine results by time with adding &as_qdr=d to the end of url, I have a problem with these hashtags in url, because anything behind them seems to be unfunctional.

It does not happen with Chrome, but Firefox reloads the page after query adding this nightmare hash:

d?=¿)a¿?)!!m!!"!"·n

My form is here

I need a javascript to block Firefox (at least) to reload adding the hash-tag

Arpit
  • 6,212
  • 8
  • 38
  • 69

3 Answers3

1

I know this is an old question but I had a similar problem.

Turns out it was the href="#" when handling the onclick event.

Use href="javascript:void(0)"

A more complete answer is here

Community
  • 1
  • 1
0

The linked site doesn't give much to test/work with. Maybe it's the language barrier, but it was not entirely clear to me how I am supposed to interact with the site so that I can try to reproduce the problem. In the future questions, try to add clear steps how to reproduce the problem.

At least, I would revise the way of appending query parameters to end of URL. The symptoms make it much look like that you're blindly appending them to the very end of the entire URL without determining/filtering the URL itself. I suggest you to use window.location.search to obtain the current query string and then build on that further. It won't include the hash fragments.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

Thank you very much for your kind answer.

I will try to let you have a run on the form, the way a visitor would do it:

The site is a Job Meta-search machine, Google personal search, (no revenues for the moment otherwise I wouldn't bother anyone here)

You begin at: http://infoprofesionales.es/pageID_10075646.html and introduce e.g "manager", enter, then redirect to result page:

chrome:

...INFOPROFES.ROOT.../pageID_results.html?cx=partner-pub-8427202809546935:rxxaj8en2yh&cof=FORID:10&ie=UTF-8&q=manger&sa=Buscar+en+60+Portales+(escriba+empleo+y+lugar+de+trabajo)

firefox:

...INFOPROFES.ROOT.../pageID_results.html?cx=partner-pub-8427202809546935%3Arxxaj8en2yh&cof=FORID%3A10&ie=UTF-8&q=manager&sa=Buscar+en+60+Portales+(escriba+empleo+y+lugar+de+trabajo)#1346

As you see FF ads the hashtag

I redirect because the result page offers three buttons which add by JavaScript the internal Google parameter (filter:time): &as_qdr=w week or d day or h hour (brilliant way to filter results not compromising the Google code (which is not allowed)

So now I`ll come to an end and it is really simple: These appendixes (&as_qdr=X) are added by the mentioned buttons to the end of the URL, and (which works in Chrome) cause a reload showing the desired filtered results.

BUT: Firefox won't work, why? because FF forces a double load (you can appreciate it lowering conn.speed) adding the second time an hash tag to the end of the url.And behind that tag: none of my parmeters takes any effect.

Chrome: no hash tag = WORKS (try and press my yellow filter links at the bottom of result site)

Firefox & IE hash tag = DOES NOT WORK (try and you will see my "&as_qdr=X" parameter behind the tag, but not igniting like in chrome)

I had to lower myself writing on the site "works only with Chrome" which is ridiculous - and I spent all kind of attempts from manipulating by java the string location, stop loading or whatever...

Never so much in vain.

It seems to lie on the hand: FF & IE load searchresults twice, first without tag then with ¿How forbid them loading twice (looks ugly anyhow).

рüффп
  • 5,172
  • 34
  • 67
  • 113