In this post I would like to analyze the use of unobtrusive script from the point of view of the Web Designer. Normally, in fact, a script that is not intrusive towards the end of the navigator!
But it can also be used for the Web Designer?
Unobtrusive JavaScript from the perspective of the Web Designer
Putting ourselves in the shoes of a web designer can identify two categories of unobtrusive JavaScript: Unobtrusive Javascript true and pseudo unobtrusive JavaScript.
Both categories, however, are not completely non-intrusive (always from the point of view of the Web Designer). A real and complete unobtrusive JavaScript should not take any action on the Web page, but this is - for now - basically impossible. The minimal operation required during the installation of a script is, however, the inclusion of the inclusion of the script itself! It is, therefore, that this operation permissible - indeed - does not even require the web designer to make regular adjustments to the structure of the page. The simple placement of the inclusion of the script tag inside the head can be therefore considered non-intrusive.
The true unobtrusive JavaScript
The scripts of this type are the only ones that require inclusion of the script and not unobtrusive; claim any operation! Scripts of this type are, for example (the usual and oft-cited), Snap . Once you entered the code include the Web Designers must not engage in any further operation, as the script snap operates on standard tags.
Pseudo unobtrusive JavaScript
These are different from previous tagging as requiring further to run correctly. Examples of this type are Control.Tabs of Ryan Johnson to slide or library Lightbox JS . per identificare i link che devono essere modificati. Lightbox JS , in particolare, richiede addirittura la presenza esplicita sia di Prototype che di Scriptaculous . The latter solution, for example, requires the inclusion in the Tag A the attribute rel to identify the links that need to be modified. Lightbox JS , in particular, requires explicit and even the presence of Prototype that Scriptaculous . As indicated on the website Lightbox JS , the inclusion of the script should look like this:
1 2 3 | "text/javascript" src = "js/prototype.js" >< / script > < script type = "text / javascript" src = "js / prototype.js"> </ script > "text/javascript" src = "js/scriptaculous.js?load=effects" >< / script > < script type = "text / javascript" src = "js / scriptaculous.js? load = effects"> </ script > "text/javascript" src = "js/lightbox.js" >< / script > < script type = "text / javascript" src = "js / lightbox.js"> </ script > |
The links that point to un'immmagine you want to view the system with Lightbox JS should be written like this:
1 |
In addition to identify a group of images, to add the ability to scroll forward and backward images, tags A be set as follows:
1 2 3 | "images/image-1.jpg" rel = "lightbox[roadtrip]" > image #1 < / a > < a href = "images/image-1.jpg" rel = "lightbox [roadtrip]"> image # 1 </ a > "images/image-2.jpg" rel = "lightbox[roadtrip]" > image #2 < / a > < a href = "images/image-2.jpg" rel = "lightbox [roadtrip]"> image # 2 </ a > "images/image-3.jpg" rel = "lightbox[roadtrip]" > image #3 < / a > < a href = "images/image-3.jpg" rel = "lightbox [roadtrip]"> image # 3 </ a > |
The need for such constraints is evident, there is no easy way to distinguish a link element (Tag A ) from another. In particular it is not possible to understand which element the designer wants to display in one way or another. Web Designer must necessarily indicate somewhat Tags and their behaviors. Are therefore required - intrusive - totally understandable, not at all diminish the usefulness and potential of these scripts. Only lead to greater detail and a few lines of code in over the Web Designer.
It is interesting, however, the double aspect of 'unobtrusive JavaScript, is analyzed in terms of both end-user point of view, Web Designer.










There are no comments for this post
Leave a comment