Essentials of Javascript - Cultural View

Essentials of Javascript - Cultural View Essentials of Javascript - Cultural View

culturalview.com
from culturalview.com More from this publisher
14.07.2013 Views

JsonML 109 }} "modified": "2006-12-31T23:59" Comparison To Similar Technologies XML/XSLT XSLT and XML can produce client-side templating as well, and both allow caching of the template separate from the data. For many, however, the syntax of JBST [2] is much easier to manage, due to its familiarity. JBST uses JavaScript natively in the template rather than requiring a mixing of a different type of control language. innerHTML While seemingly used to perform similar tasks, JsonML and innerHTML are quite different. innerHTML requires you to have all the markup exactly as you want it ready to go, meaning that either the server is rendering the markup, or you are performing expensive string concatenations in JavaScript. JsonML uses client-side templating through JBST, which means that HTML is converted into a JavaScript template at build time. At runtime, the data is supplied and DOM elements are the result. The resulting DOM elements can be inserted or replace an existing element—something innerHTML cannot easily do without creating excess DOM elements. Rebinding only requires requesting additional data, which is smaller than fully-expanded markup. As a result, large performance gains are often made, since the markup is requested (or cached) separately from the data. HTML Message Pattern / Browser-Side Templating For simplicity, innerHTML has been the preferred method for the HTML-Message pattern [5] style of Ajax. However, tools like JsonFx [6] aim to simplify JsonML and JBST implementation while still providing a full browser-side templating Ajax pattern. [7] External links • JsonML.org [8] • IBM developerWorks Article [9] • Java JSONML implementation [10] - written by Douglas Crockford • JsonFx.NET [11] - C#/.NET JBST Framework References [1] http://jsonml.org/Ajax-UI/Binding/ [2] http://jsonml.org/bst [3] http://jsonml.org/BST/Example [4] http://tech.groups.yahoo.com/group/json/message/1115 [5] http://ajaxpatterns.org/HTML_Message [6] http://jsonfx.net [7] http://ajaxpatterns.org/Browser-Side_Templating [8] http://jsonml.org [9] http://www.ibm.com/developerworks/library/x-jsonml/ [10] http://json.org/javadoc/org/json/JSONML.html [11] http://jsonfx.googlecode.com

Lightbox (JavaScript) 110 Lightbox (JavaScript) A webpage showing a Lightbox 2 window. Developer(s) Lokesh Dhakar Stable release 2.04 / March 9, 2008 Development status Stable Operating system Cross-platform Available in English License Creative Commons Attribution 2.5 License Website [1] Lightbox, and the newer Lightbox 2, is a JavaScript application used to display large images using modal dialogs. The script has gained widespread popularity due to its simple yet elegant style and easy implementation. While it was initially developed from scratch, Lightbox has since been modified to use a number of JavaScript libraries (such as the Prototype Javascript Framework [2] and script.aculo.us [3] for its animations and positioning), in order to reduce the size of the code. [4] The release of Lightbox encouraged other developers to work on similar projects, resulting in products such as the later Thickbox and lighter Slimbox. [4] How it works On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of the image using a gliding animation. Lightbox determines which images will be shown in the modal window through the XHTML "rel" attribute, which is used on an element wrapped around the element. Lightbox also provides a way to attach captions to images and to run a slide show, which can be navigated using the arrow keys. Functionality Lightbox permits users to view larger versions of images without having to leave the current page, [5] and is also able to display simple slideshows. The use of the dark background, which dims the page over which the image has been overlaid, also serves to highlight the image being viewed. While Lightbox is dependent upon a browser's compatibility with Prototype to function, [3] Lightbox is triggered through a standard link tag. Thus browsers that do not support JavaScript simply load the image as a separate file, losing the Lightbox effect but still retaining the ability to display the full-sized image. [5] Even so, some compatibility problems have been identified with versions of Lightbox, in particular when displaying larger images on Firefox or Opera. [6] Many users have also noted that there is a lack of compatibility across the Internet Explorer range of browsers. However, many times the compatibility issues can be attributed to users not reading the documentation on how to make lightbox function correctly in these browsers.

Lightbox (JavaScript) 110<br />

Lightbox (JavaScript)<br />

A webpage showing a Lightbox 2 window.<br />

Developer(s) Lokesh Dhakar<br />

Stable release 2.04 / March 9, 2008<br />

Development status Stable<br />

Operating system Cross-platform<br />

Available in English<br />

License Creative Commons Attribution 2.5 License<br />

Website [1]<br />

Lightbox, and the newer Lightbox 2, is a JavaScript application used to display large images using modal dialogs.<br />

The script has gained widespread popularity due to its simple yet elegant style and easy implementation. While it<br />

was initially developed from scratch, Lightbox has since been modified to use a number <strong>of</strong> JavaScript libraries (such<br />

as the Prototype <strong>Javascript</strong> Framework [2] and script.aculo.us [3] for its animations and positioning), in order to reduce<br />

the size <strong>of</strong> the code. [4] The release <strong>of</strong> Lightbox encouraged other developers to work on similar projects, resulting in<br />

products such as the later Thickbox and lighter Slimbox. [4]<br />

How it works<br />

On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes<br />

itself according to the size <strong>of</strong> the image using a gliding animation. Lightbox determines which images will be shown<br />

in the modal window through the XHTML "rel" attribute, which is used on an element wrapped around the<br />

element. Lightbox also provides a way to attach captions to images and to run a slide show, which can be<br />

navigated using the arrow keys.<br />

Functionality<br />

Lightbox permits users to view larger versions <strong>of</strong> images without having to leave the current page, [5] and is also able<br />

to display simple slideshows. The use <strong>of</strong> the dark background, which dims the page over which the image has been<br />

overlaid, also serves to highlight the image being viewed.<br />

While Lightbox is dependent upon a browser's compatibility with Prototype to function, [3] Lightbox is triggered<br />

through a standard link tag. Thus browsers that do not support JavaScript simply load the image as a separate file,<br />

losing the Lightbox effect but still retaining the ability to display the full-sized image. [5] Even so, some compatibility<br />

problems have been identified with versions <strong>of</strong> Lightbox, in particular when displaying larger images on Firefox or<br />

Opera. [6]<br />

Many users have also noted that there is a lack <strong>of</strong> compatibility across the Internet Explorer range <strong>of</strong> browsers.<br />

However, many times the compatibility issues can be attributed to users not reading the documentation on how to<br />

make lightbox function correctly in these browsers.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!