Thread:User talk:CodeCat/User:CodeCat/lookup language

Since you asked for feedback, some nitpicks in no particular order:
 * You will be better off enabling JSHint options that I recommended. Especially.
 * You declared a dependency on LegacyScripts, but you are not using it anywhere. LegacyScripts should not be depended upon anyway. Having (new) scripts depend upon it defeats its only purpose: to make it possible to be disabled.
 * The js function could be integrated straight into the js handler; well, unless you plan to call it from somewhere else.
 * I tend to keep one long-lived js object instead of creating a new one every time I need to call the API. Repeatedly constructing and destroying objects costs some time.
 * js may not work in some IEs IIRC, some of which we might want to support. I do not really remember which.
 * If you had the form as a raw DOM node instead of a jQuery wrapper, you could access fields like: js (where inputName is the name property of the field). Though see below for an alternative, I think a less fragile one.
 * Some error handling would be nice. And more features, like looking up scripts, and reverse lookup (i.e. by name). And why force people to navigate to a specific page to use this? Though I realise this is just a prototype. Right?
 * xte has a similar feature already, implemented a bit differently.
 * I think Module:languages/JSON repacking one abstraction into another abstraction shows how the whole object-orientation business imposed upon Lua is silly.
 * Placement of . Nearly every serious JS library (and some [//github.com/mattdiamond/fuckitjs/blob/master/fuckit.js non-serious libraries]) follows (Crockford's variant of) K&amp;R here.
 * I really dislike jQuery. This may be just my taste, but I find that library too bloated, and I avoid using it unless 1) MediaWiki forces me to, or 2) I think I would end up writing a half-hearted reimplementation of something jQuery does already anyway if I avoided using it. I never use jQuery for constructing DOM — I tend to use the js function I copy everywhere (I really need to put it in a library), which is similar to js we have in LegacyScripts. You give it arguments describing a DOM element, and it returns a fully-formed node. The main advantage comes when you combine that with assignment-expressions:
 * The code can be written quickly, executes quickly (almost at the speed of calling DOM methods directly; no string parsing voodoo like jQuery does), and when you get a bit used to it, is quite readable.


 * Also, if you use jQuery anyway, please be consistent — either use js or js.