Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chrome上的“后退”按钮可以重新解释Javascript,但不能在Firefox/IE中进行解释_Javascript_Google Chrome_Back Button - Fatal编程技术网

Chrome上的“后退”按钮可以重新解释Javascript,但不能在Firefox/IE中进行解释

Chrome上的“后退”按钮可以重新解释Javascript,但不能在Firefox/IE中进行解释,javascript,google-chrome,back-button,Javascript,Google Chrome,Back Button,我正在构建一个页面,用户可以通过React组件编辑对象(问题不涉及React直接,不需要此框架中的专业知识)。为了性能和简单性,初始对象存储在发送给用户的HTML中的JSON中,每个React组件都使用该对象初始化 <html> <head> <script>var OBJ = {'foo': 'bar', 'foo2': 'baz'};</script> <body>... <script s

我正在构建一个页面,用户可以通过React组件编辑对象(问题不涉及React直接,不需要此框架中的专业知识)。为了性能和简单性,初始对象存储在发送给用户的HTML中的JSON中,每个React组件都使用该对象初始化

<html>
<head>
    <script>var OBJ = {'foo': 'bar', 'foo2': 'baz'};</script>

    <body>...

        <script src="my_react_components.jsx"></script>
    </body>
</html>
test
显示在Chrome的控制台中,如果我们来自后退按钮,而不是Firefox

我如何解决这个问题?我不知道这是否相关,但是

<!DOCTYPE html>
<html>
<body>
    <a href="https://stackoverflow.com">Click</a>
    <script>console.log('test');</script>
</body>
</html>