开发者

Meta Refresh with #-anchor going into loop

开发者 https://www.devze.com 2023-02-07 08:16 出处:网络
The following construct, <meta http-equiv=\"refresh\" content=\"3;url=#scroll\" /> when accessed from http://localhost/, redirects all browsers to http://localhost/#scroll, and no further re

The following construct,

<meta http-equiv="refresh" content="3;url=#scroll" />

when accessed from http://localhost/, redirects all browsers to http://localhost/#scroll, and no further redirecting occurs as expected.

However, when the very same construct is used from the target url, h开发者_开发技巧ttp://localhost/#scroll, firefox and opera keep refreshing the page every 3 seconds, making http requests to the server, regardless of the fact that the url for redirect has already been reached.

Is there any explanation and/or fix for this?

NB for possible solutions: JavaScript is unavailable in this specific situation.


In case you're interested, what Firefox is doing is that it normally treats meta refresh as a forced new document load. But in the case where the URI changes within 15 seconds, it changes it to a replace. And then later on this lets the anchor scroll check succeed.


I don't think meta refresh was designed to jump to anchors.

If you can't use JavaScript, you can't automate it.

0

精彩评论

暂无评论...
验证码 换一张
取 消