Javascript eval on global scope?

后端 未结 6 833
长发绾君心
长发绾君心 2020-12-01 10:33

Is it possible to use the eval command to execute something with a global scope? For example, this will cause an error:



        
6条回答
  •  温柔的废话
    2020-12-01 10:43

    You should be able to use eval() in global scope by calling it indirectly. However, not all browsers are currently doing this.

    Further Reading.

提交回复
热议问题