4 ms·
I always thought unobtrusive javascript refers to how it is written. For example, using the inline onClick attribute would be considered obtrusive, because it
by mdg 17y ago
I always thought unobtrusive javascript refers to how it is written. For example, using the inline onClick attribute would be considered obtrusive, because it is in the HTML. On the other hand, unobtrusive javascript would assign a function to some control when the window loads, effectively making the HTML pure.
- _pius 17y agoYou're both right. By separating the Javascript from the HTML, you make it easier for the site to degrade gracefully. (Though you still have to design specifically for graceful degradation if you're serious about it)