$ is not defined Javascript

前端 未结 3 1327
北恋
北恋 2021-02-12 23:55

I\'m writing a piece of code currently in tampermonkey and I can\'t work out why i get this error in the console of google chrome,\"Execution of script \'PalaceBOT\' failed! $ i

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 00:39

    I didn't find a better answer other than this.

    In general, this chunk of code defines the library for further usage inside tampermonkey editor.

    /*globals MY_LIB*/ using this will take off all warnings.

    For more information check this (https://jshint.com/docs/#inline-configuration). It explains what globals are, and how do they work.

提交回复
热议问题