Firefox 6 Infinite Page Refresh With Page With Hash Tags

谁说我不能喝 提交于 2019-11-27 08:12:29
frank hadder

Turns out, this is an issue with an old version of MicrosoftAjax.js (the one that comes installed with Asp.Net MVC 2).

Open up the MicrosoftAjax.debug.js file and check the file version number. The top of this file will look like this if this is your problem:

 // Name:        MicrosoftAjax.debug.js
 // Assembly:    System.Web.Extensions
 // Version:     4.0.0.0
 // FileVersion: 4.0.20526.0

That's the version that contains this bug. The latest file version as of this writing is 4.0.30205.0. Upgrade to the latest version and the problem goes away. As mentioned in a comment by Nathan Fox, I got the latest version from the Microsoft cdn and more specifically the minified and debug versions.

For the curious, I traced the problem down in the javascript file.

The buggy version includes:

 if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash && (!window.frameElement || window.top.location.hash)) {
      window.history.go(0);
 }

Which was corrected to the following in the newer version:

 if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash && (!window.frameElement || window.top.location.hash)) {
      (Sys.Browser.version < 3.5) ?
      window.history.go(0) :
      location.hash = this.get_stateString();
 }

Deleting MicrosoftAjax.js or MicrosoftAjax.debug.js may help, but just replacing the files with the current versions from http://www.asp.net/ajaxlibrary/CDNAjax4.ashx will do the job, too!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!