01_jQuery_pres.ppt
- Количество слайдов: 24
Java. Script frameworks Ivan Chyr
Frameworks overview • j. Query - j. Query is a fast and concise Java. Script Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. • Ext. JS - Ext JS is a Java. Script framework for building rich internet applications that work in any web browser. • YUI - The YUI Library is a set of utilities and controls, written with Java. Script and CSS, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. • MVC: Java. Script. MVC, Spine, Backbone
What is j. Query? • j. Query is Java. Script. • It’s lightweight library (32 kb minified and GZIPed) • Easy and fast HTML DOM Selection • Built to work on all modern browsers ( IE 6+, FF 2. 0+, Safari 3. 0+, Opera 9+, Chrome 1. 0+ ) • It’s Open Source www. bestjquery. com
if ( browser. Type == “gecko” ) document. popped. Layer =eval(‘document. get. Element. By. Id(“Hidden. DIV”)’); else if ( browser. Type == “ie” ) document. popped. Layer =eval(‘document. get. Element. By. Id(“Hidden. DIV”)’); else document. popped. Layer =eval(‘document. layers[“Hidden. DIV”]’); Document. popped. Layer. style. visibility = “visible”;
• That was Java. Script way…. • j. Query does this in this manner: $(“#Hidden. DIV”). show();
2. Using j." src="https://present5.com/presentation/3/20401202_173584951.pdf-img/20401202_173584951.pdf-6.jpg" alt="<< Installation >> 1. Referencing to downloaded library 2. Using j." />
<< Installation >> 1. Referencing to downloaded library 2. Using j. Query from other sites (e. g. Google, Microsoft, etc. )
j. Query Philosophy 1. Find some HTML 2. Do something with it
Syntax Basic syntax is: $(selector). action() : • A $ sign to define/access j. Query • A (selector) to "query (or find)" HTML elements • A j. Query action() to be performed on the element(s)
Syntax : : : example 1 • $(this). hide() - hides the current element • $("p"). hide() - hides all
elements • $(". test"). hide() - hides all elements with class="test“ • $("#test"). hide() - hides the element with id="test“ Simple. Selectors. html
Syntax : : : selectors Syntax Description $("*") Selects all elements $(this) Selects the current HTML element $("p. intro") Selects all
elements with class="intro" $("p: first") Selects the first
element $("ul li: first") Selects the first
- $("ul li: first-child") Selects the first
- element of every
- $("[href]") Selects all elements with an href attribute $("a[target='_blank']") Selects all elements with a target attribute value equal to "_blank" $("a[target!='_blank']") Selects all elements with a target attribute value NOT equal to "_blank" $(": button") Selects all
















