Jump to content

Talk:Unobtrusive JavaScript

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Timdown (talk | contribs) at 08:29, 1 July 2010 (Incorrect example: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

POV going to be removed

User:Backzlider seem to have a few issues with Unobtrusive JavaScript and through the use of many WP:AWW Weasel Words like "it could be argued" he tries to put the concept down. When he says that the article by Stuart Langridge might be called hijacked it is almost entertaining. In that very article Stuart Langridge shows perfect examples of how to add a behavioral layer on top of the HTMl and CSS using nothing but the class attribute in the HTML. Backzliderz's discussion about "browser events" is also very confusing. Bringing back NPOV and simultaneously improving the article will require a general rewrite.

I do not have my copy of david Flanagan's Definitive Guide (5th ed) in which he describes unobtrusive JavaScript (quite favourably, BTW). I will add it as a reference when I get back to my library. --itpastorn (talk) 11:58, 3 December 2009 (UTC)[reply]

Is 'Unobtrusive JavaScript' a distinct concept worthy of a wikipedia article?

I'm very much in favour of the techniques this article is suggesting, but it seems to me that it might be a bit of a disguised how-to or essay article, and that 'Unobtrusive JavaScript' might not really exist as a distinct concept worthy of a wikipedia article.

Unless evidence can be dug up of a definite "Unobtrusive Javascript" movement it;s probably a candidate for merger or deletion. Artw 02:36, 27 January 2007 (UTC)[reply]

A Google search for the phrase "unobtrusive javascript" turns up 138,000 results. There's a book about it. It's been formally discussed at web development conferences. The influential site alistapart.com has an article about it. The term is commonly used, with the meaning that's described in this Wikipedia article, on mailing lists, blogs, and web development tutorials across the web: example, example, example. (Examine the example sources from the last link to see that the term is, in fact, being used to describe a specific methodology that stresses separation of programmatic behavior from markup.) People have written class libraries specifically to faciliate unobtrusive JavaScript development. This blog actually uses the phrase "unobtrusive JavaScript movement".

Need more? :) Greenie2600 04:04, 27 January 2007 (UTC)[reply]

Fair enough. I'm reasonably happy. Artw 17:08, 27 January 2007 (UTC)[reply]

Since the issue seems to be resolved, I removed the sources needed flag from the main page. Amitchaudhary 01:25, 1 February 2007 (UTC)[reply]

Doesn't the example lead to a memory leak?

Burn the heretic!

83.70.247.123 22:59, 25 July 2007 (UTC)[reply]

Emerging trend? People have advocated this kind of thing for years. —Preceding unsigned comment added by SigmaB8a (talkcontribs) 16:08, 20 September 2007 (UTC)[reply]

While I'm sure that there are earlier examples of Unobtrusive JavaScript the earliest that I am aware of are from Microsoft with IE4 and Behaviours (HTCs - HyperText Components) which unlike the current trend formally specifies the interface and seperation of the JavaScript from the markup that its acting upon. With Behaviours JavaScript is attached by means of CSS.

The current MS documentation on Behaviours can be found on MSDN [1]

It's my personal view that we'd be a lot further along if the work MS did in this area had been paid more attention. Carnagh 09:01, 24 September 2007 (UTC)[reply]

I think the relevant point here is that we're really talking about "unobtrusive" "JavaScript", not "Unobtrusive JavaScript". I.e. a qualification and design principle applied to the use of one programming language, not some singular, well-defined, noteworthy concept, idea, movement, programming ideology, topic, or anything even vaguely resembling something that would warrant an article in an encyclopedia. I mean, can anybody even define what makes a certain piece of JavaScript "Unobtrusive", as against just unobtrusive/in-accordance-with-good-coding-practice/good-as-in-not-as-bad-as-javascript-used-to-be?

Then, as a counter example, certainly there are quite a number of references in the literature to "nice girls" or "posh homes". Probably more than one book has been written about both, and articles with those sorts of titles abound even in the academic setting. But that happens not because the topic is well-defined and worthy of an encyclopedia article; rather it happens because the choice of words, and in particular the clarification afforded by the preceding, grammatically productive adjective, is both easily thought of and germane to the situation.

Clearly none of this makes for a concept worthy of description separate from the underlying terms. We already know what "unobtrusive" means, as well as "JavaScript". "Unobtrusive JavaScript" seems to me to be simply the usual productive combination of two terms, without any extra, autonomous content/meaning. As such, I'd conclude that the article at most ought to be merged with JavaScript, as a modern historical sideline on the usage patterns of the language, if not outright deleted.

Decoy (talk) 17:44, 5 August 2008 (UTC)[reply]

Incorrect example

The examples from the "Separation of behavior from markup" section are not equivalent. Firstly, 'document.getElementsByName("date")[0]' will return the first element with a name attribute of "date", which clearly is not guaranteed to be the input we want: other inputs may legally have a name attribute of "date", as could an <a> element. Secondly, the library examples will apply the "change" event to all input elements with name attribute of "date", not just the one we're interested in. I would suggest for clarity and lack of ambiguity that the example should be modified to use an ID to identify the input element of interest.