像往常一样,我设置表单验证的规则,如果它们没有通过,我$this->load->view()
会再次使用并加载表单。
在 Firefox 和 Opera 上一切正常。但是在所有其他浏览器中,当表单验证没有通过并且再次加载表单时,文档会被格式化。我使用 HTML Tidy 来检查我是否错过了结束标签或其他东西,但一切都很好。
我还使用 W3C HTML5 Validator 检查了源代码。文件通过,没有错误。然后,我运行了表单验证并再次检查了相同的源代码。这次验证器出现了 5 个错误。
Line 2, Column 1: Non-space characters found without seeing a doctype first. Expected <!DOCTYPE html>.
<!DOCTYPE html>
Line 2, Column 1: Element head is missing a required instance of child element title.
<!DOCTYPE html>
Content model for element head:
If the document is an iframe srcdoc document or if title information is available from a higher-level protocol: Zero or more elements of metadata content.
Otherwise: One or more elements of metadata content, of which exactly one is a title element.
Line 2, Column 16: Stray doctype.
<!DOCTYPE html>
Line 3, Column 19: Stray start tag html.
<html lang="pt-br">
Line 3, Column 19: Cannot recover after last error. Any further errors will be ignored.
<html lang="pt-br">
<!DOCTYPE html>
我知道,在事情变得糟糕之前,当有事情发生时。但我那里没有任何变量。也许 CI 正在产生一些东西。
有没有人可以帮忙?