“alert” is not defined when running www.jshint.com

后端 未结 8 1882
长发绾君心
长发绾君心 2020-12-15 02:46

I fixed this by simply adding var alert; However, is this what I should be doing to get the pesky error message to go away? Here is the fix. Here is the fail

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 03:09

    Use .jshintrc file or CTRL + , in VS Code, to edit options for jshint.

    in js alert(data.status); or window.alert(data.status);

    "window": true,
    "alert": true
    

    or best

    "devel": true,
    
    {
    "esversion": 6,
    "browser": true,
    "undef": true,
    "varstmt": true,
    "forin": true,
    "unused": true,
    "funcscope": true,
    "lastsemic": true,
    "moz": true,
    "jquery": true,
    "module": true,
    "devel": true,
    "globals": {
        "window": true,
        "document": true,
        "console": true,
        "alert": true
    }
    

    }

提交回复
热议问题