undefined|0|ReferenceError: Strict mode forbids implicit creation of global property 'csrf_token'

可紊 提交于 2019-11-29 09:24:38

It is telling you that a value is being assigned to a variable called csrf_token that has not been declared, e.g.

csrf_token = 'foo';

In non–strict mode, that will create a property of the global object (usually called a global variable) called csrf_token when that line of code is executed.

In strict mode, it will throw the error you see because strict mode prevents the implicit creation of global variables. You could also fix it by including:

var csrf_token;

anywhere in a global context in the same script element as the code the error comes from, or a previous script element.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!