Chrome:未捕获错误:can't在同一帧中加载XRegExp两次

Chrome: Uncaught Error: can't load XRegExp twice in the same frame

本文关键字:一帧 两次 XRegExp 加载 错误 can Chrome      更新时间:2023-09-26

以下代码将在两台不同的计算机上(Windows 7和Chrome 12.0.742.100)的两种Chrome中失败

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>Test</title>
        <script type="text/javascript">
            location.hash = "#one";
            location.hash = "#two";
            location.hash = "#three";
        </script>
    </head>
    <body>
        This will error out "Uncaught Error: can't load XRegExp twice in the same frame" in chrome. Anyone got an answer?
    </body>
</html>

我觉得我什么都试过了。有人能在chrome上确认这个错误吗?有人知道我该如何修复它吗?非常感谢。

错误的URL:http://jalsoedesign.net/test/hashchanging/

我应该添加:它运行良好,做了它应该做的事情(更改页面哈希),但仍然会出现错误。

它在Win7上的Chrome 12.0.742.100上运行良好。我假设你已经安装了扩展?禁用所有扩展(或转到隐身模式),然后尝试再次加载页面。来自内容脚本的错误也显示在javascript控制台中。如果您的页面上没有使用XRegExp,那么其中一个扩展可能会使用。

编辑:

异常的来源应位于右侧。单击它可转到导致异常的脚本。

使用XRegExp的扩展应该升级到v2.0.0或更高版本。这将避免此错误,即使XRegExp在同一帧中(不适当地)加载了多次。