<!DOCTYPE html> <html> <head> <title>jslint test</title> </head> <body> <button id="button1" type="button">Push</button> <div id="msg"></div> <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="hatena.js"></script> </body> </html>
/* * hatena.js */ /*jslint browser : true, continue : true, devel : true, indent : 2, maxerr : 50, newcap : true, nomen : true, plusplus : true, regexp : true, sloppy : true, vars : false, white : true */ /*global $ :true */ $("#button1").click(function(){ $.ajax({ url: "http://b.hatena.ne.jp/entry/json/?url=http%3A%2F%2Fwww.hatena.ne.jp%2F", type: "GET", dataType: "jsonp", jsonp: "callback", timeout: 1000, cache: false, success: function(data){ $("#msg").html(""); $("#msg").append(data.title + "<br/>"); $("#msg").append(data.entry_url); }, error: function(){ $("#msg").html("ERROR"); } }); });
$ ./node_modules/.bin/jslint hatena.js hatena.js is OK.
/* * hatena.js */ /*jslint browser : true, continue : true, devel : true, indent : 2, maxerr : 50, newcap : true, nomen : true, plusplus : true, regexp : true, sloppy : true, vars : false, white : true */ $("#button1").click(function(){ $.ajax({ url: "http://b.hatena.ne.jp/entry/json/?url=http%3A%2F%2Fwww.hatena.ne.jp%2F", type: "GET", dataType: "jsonp", jsonp: 'callback', timeout: 1000, cache: false, success: function(data, status){ $("#msg").html(""); $("#msg").append(data.title + "<br/>"); $("#msg").append(data.entry_url); }, error: function(){ $("#msg").html("ERROR"); } }); });
hidetomo@www4322gi:~/work/jslint$ ./node_modules/.bin/jslint hatena.js hatena.js #1 '$' was used before it was defined. $("#button1").click(function(){ // Line 12, Pos 1 #2 '$' was used before it was defined. $.ajax({ // Line 13, Pos 3 #3 '$' was used before it was defined. $("#msg").html(""); // Line 21, Pos 7 #4 '$' was used before it was defined. $("#msg").append(data.title + "<br/>"); // Line 22, Pos 7 #5 '$' was used before it was defined. $("#msg").append(data.entry_url); // Line 23, Pos 7 #6 Unused 'status'. success: function(data, status){ // Line 20, Pos 29 #7 '$' was used before it was defined. $("#msg").html("ERROR"); // Line 26, Pos 7
Streamlit is a …
I bought M5Stac…