html - 为什么 Chrome 不使用元刷新重定向

标签 html google-chrome redirect meta

我使用的一个应用程序有一个 PL/SQL 包,它创建一个页面并使用一个函数来创建 META 标签。

它创建一个带有 META 标签的网页,就像这样:

 <META HTTP-EQUIV="Refresh" NAME="Refresh" CONTENT="1; URL=PaymentSubmit.html">

问题是 Chrome 不喜欢 NAME="Refresh"属性。它不重定向页面,尽管它在 IE 和 Firefox 中正确重定向

如果我删除 NAME 属性,它看起来像这样它在所有浏览器中都可以工作:

 <META HTTP-EQUIV="Refresh" CONTENT="1; URL=PaymentSubmit.html">

这是怎么回事?我找不到用于 META 重定向的 W3C 标准,那么每个浏览器是否都制定了自己的规则?我不确定它是否曾在 Chrome 中运行过,但由于我从未听说过任何错误报告,我认为它曾经在 Chrome 中运行过。

有人遇到过类似的问题吗?

谢谢

最佳答案

如果你勾选the w3c wiki你可以找到以下引述:

Exactly one of the name, http-equiv, and charset attributes must be specified.

这意味着设置了 namehttp-equiv 属性不是有效的 html。

阅读this W3C's HTML and XHTML Techniques test on meta refresh :

Find all meta elements in the document. For each meta element, check if it contains the attribute http-equiv with value "refresh" (case-insensitive) and the content attribute with a number greater than 0 followed by ;'URL=anyURL' (where anyURL stands for the URI that should replace the current page).

其他浏览器的行为没有错,但chrome更严格。

有关正确行为和有效引用的更多详细信息,请访问 http://www.w3.org/TR/html5/document-metadata.html#attr-meta-http-equiv-refresh

关于html - 为什么 Chrome 不使用元刷新重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22551976/

相关文章:

php - 最好的重定向方法?

javascript - 多个视频作为背景 : HTML5 or YouTube?

javascript - 自定义字体在显示之前不会加载(显示时不会加载 : none)

html - 如何对齐输入标签以垂直对应?

javascript - 在 Chrome 浏览器中检测插件版本

javascript - Chrome 和 Auto 执行一个 javascript 函数

css - 仅适用于 Chrome 的 AutoCompleteExtender 定位

wordpress - Wordpress 的所有公共(public)/直接入口点是什么?

从非 ssl 端口 8080 重定向到 ssl 端口 8443

javascript - Jquery更改文本按钮显示更多/显示更少