title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Wednesday, November 26, 2014 | |
So we all know how to run JSLint from Node, but what if you want to use Firebug or something to step through? The version Crockford uses on jslint.com is minimized and includes a lot of overhead you don't need to run locally (http://jslint.com/webjslint.js). It's obviously not that difficult to set up. Here's the easy version. I'm not sure how well the formatting will keep with this email-to-blog post, but hopefully I'll eventually remember to return and clean it up. So save the below into index.html and knock yourself out. No jQuery or nuttin required. Gosh, I hope this post works. HTML always worries me with Blogger. It's anyone's guess how it'll parse it this week. <html>
<head>
<script src="jslint.js"></script>
<script>
function jslintalizeMe()
{
var i, divOut, errs, errsMsg = "";
divOut = document.getElementById("errors");
divOut.innerHTML = "";
if (!JSLINT(document.forms[0].elements[0].value))
{
errs = JSLINT.errors;
for (i=0; i < errs.length; i++)
{
err = errs[i];
if (null !== err)
{
if (undefined !== err.id)
{
errsMsg += "Error: "
+ err.code
+ " -- line "
+ err.line
+ " char "
+ err.character + "<br />"
+ " "
+ err.evidence + "<br />"
+ " " +
err.reason + "<br /><br />\n";
}
else
{
errsMsg += err.reason;
}
}
}
divOut.innerHTML = errsMsg;
}
}
</script>
</head>
<body>
<form>
<textarea rows="24" cols="80"
placeholder="// Paste quality code here"></textarea>
<br />
<button onclick="jslintalizeMe();return false;">JSLint</button>
</form>
<div id="errors"></div>
</body>
</html>
Look, that's ugly, I get it. But it's the easiest way to get JSLint running in a good, easily Firebuggable fashion. Enjoy. ;^)Labels: javascript, JSLint posted by ruffin at 11/26/2014 10:52:00 AM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|