为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

What can I do if all HTML links refresh site instead of redirecting properly (FF only, HTML 1.0 Strict valid, no plugins) just after using autocompleted url?

  • 3 个回答
  • 1 人有此问题
  • 4 次查看
  • 最后回复者为 Whitend

more options

I was testing a XHTML 1.0 Strict valid website on my localhost. It had URL "http://localhost/visaita/tictactoe/Web/index.php?item_id=8&game_password=73|55fc84c0c432ad625a901caaa13108aa&chat_code=74|50b3b60c8be203.98819772#.ULO2EnC23XQ". If I click in URL field between 8 and ?. Then pres shift + end and delete the rest of URL, I get a drop down of suggestions. Then I press arrow left in my keyboard - suggestions dissappear. I press enter and my URL is immediately reset to initial one (with all arguments) even though I wanted to delete them. Server receives all the arguments, so this is not the case of a back-end redirection (tested).

The most interesting effect is that after such refresh ALL HTML LINKS stop working. They refresh page instead of redirecting. Even if I click on a link redirecting to another domain, page still gets refreshed and not redirected. I see it as an obvious and serious bug which happens in very special conditions.

All FF plugins and add-ons disabled. Tested in safe mode as well. One interesting fact is that this page is opened by a redirect from another page (JavaScript performs redirect), but the page where error happens does not contain any JavaScript redirection code. Error console is also empty.

During these redirects FireBug (when enabled) displays interesting stuff. It shows that request without arguments is pending infinitely while immediately after it another request is launched with all unwanted arguments.

Another interesting fact is that page is using late polling AJAX technique (not sure whether it has any impact).

It seems that it is some caching bug.

I was testing a XHTML 1.0 Strict valid website on my localhost. It had URL "http://localhost/visaita/tictactoe/Web/index.php?item_id=8&game_password=73|55fc84c0c432ad625a901caaa13108aa&chat_code=74|50b3b60c8be203.98819772#.ULO2EnC23XQ". If I click in URL field between 8 and ?. Then pres shift + end and delete the rest of URL, I get a drop down of suggestions. Then I press arrow left in my keyboard - suggestions dissappear. I press enter and my URL is immediately reset to initial one (with all arguments) even though I wanted to delete them. Server receives all the arguments, so this is not the case of a back-end redirection (tested). The most interesting effect is that after such refresh ALL HTML LINKS stop working. They refresh page instead of redirecting. Even if I click on a link redirecting to another domain, page still gets refreshed and not redirected. I see it as an obvious and serious bug which happens in very special conditions. All FF plugins and add-ons disabled. Tested in safe mode as well. One interesting fact is that this page is opened by a redirect from another page (JavaScript performs redirect), but the page where error happens does not contain any JavaScript redirection code. Error console is also empty. During these redirects FireBug (when enabled) displays interesting stuff. It shows that request without arguments is pending infinitely while immediately after it another request is launched with all unwanted arguments. Another interesting fact is that page is using late polling AJAX technique (not sure whether it has any impact). It seems that it is some caching bug.

被采纳的解决方案

Ok, I know the reason now. Not sure it should work this way though. When page is reloaded, ajax requests are cancelled but as a result to that readyState becomes 4 and responseText carries empty content. This means that even though request is cancelled my JavaScript code still receives ajax response which is not expected and does not carry valid JSON format. As a result and my fail-safe feature, JavaScript code reloads the page. Even though a link is already pressed in page, my JavaScript manages to change the location of redirection to the same URL. In other words reload happens instead of redirection.

定位到答案原位置 👍 0

所有回复 (3)

more options

It seems that it is related to late polling. If ajax is in the middle of work, links refresh page. If JavaScript is not in the middle of ajaxing, everything works fine.

more options

Autocompleted URL does not seem to be related in order to provoke the bug. If I press Esc and then immediately press on links, they all work fine. Without pressing Esc, if long polling is in action, all links redirect the same page. Long polling request happens for no longer that 2 minutes and then there is a 1 second JS delay before the next one. If links are pressed between calls, they work fine.

The strange thing though is that my friend has prepared a simple script which is generating a long polling request and has a link to Google. This test works, so I am trying to understand whether there is any additional factor which is causing the problem. Perhaps it can be due to having redirects and 2 simultaneous long polling requests at the same time. Doing my best to understand the problem. Not sure what is happening although I am quite sure that problem is caused by the FF browser somehow. Tested everything back and forth.

more options

选择的解决方案

Ok, I know the reason now. Not sure it should work this way though. When page is reloaded, ajax requests are cancelled but as a result to that readyState becomes 4 and responseText carries empty content. This means that even though request is cancelled my JavaScript code still receives ajax response which is not expected and does not carry valid JSON format. As a result and my fail-safe feature, JavaScript code reloads the page. Even though a link is already pressed in page, my JavaScript manages to change the location of redirection to the same URL. In other words reload happens instead of redirection.