Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 151 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
151
Dung lượng
2,86 MB
Nội dung
[...]... jQuery:NovicetoNinja (www.sitepoint.com) 393 Preface No matter what kind of ninja you are—a cooking ninja, a corporate lawyer ninja, or an actual ninja ninja—virtuosity lies in first mastering the basic tools of the trade Once conquered, it’s then up to the full-fledged ninjato apply that knowledge in creative and inventive ways In recent times, jQuery has proven itself to be a simple... Unleash your inner jQuery ninja today! 5 6 jQuery:NovicetoNinja cinch to completely rid your markup of inline scripting, thanks to its ability to easily hook elements on the page and attach code to them in a natural, CSS-like manner jQuery lacks a mechanism for adding inline code, so this separation of concerns leads to leaner, cleaner, and more maintainable code Hence, it’s easy to do things the right... test to see if a certain feature is available to the user, and easily build applications that degrade gracefully on older browsers, or those not standards-compliant jQuery UI jQuery has already been used to make some impressive widgets and effects, some of which were useful enough to justify inclusion in the core jQuery library itself Unleash your inner jQuery ninja today! 3 4 jQuery:Noviceto Ninja. .. are key to understanding jQuery, and briefly touch on the basic syntax required to call jQuery into action Chapter 2: Selecting, Decorating, and Enhancing Ostensibly, jQuery’s most significant advantage over plain JavaScript is the ease with which it lets you select elements on the page to play with We’ll start off jQuery: Novice toNinja (www.sitepoint.com) xix this chapter by teaching you how to use... jQuery ninja today! 11 12 jQuery: Novice toNinja hide in your own code, one of the functions would be overwritten, leading to unanticipated events and errors We say that the jQuery library is contained in the jQuery namespace Namespacing is an excellent approach for playing nicely with other code on a page, but if we’re going to use a lot of jQuery (and we are), it will quickly become annoying to have to. .. that are related—but not critical to the topic at hand Think of them as extra tidbits of information Make Sure You Always … … pay attention to these important points Watch Out! Warnings will highlight any gotchas that are likely to trip you up along the way jQuery: Novice toNinja (www.sitepoint.com) Chapter 1 Falling in Love with jQuery So you have the coding chops to write lean, semantic HTML—and... It looks suspiciously like our original example—but instead of pointing the script tag to a local copy of jQuery, it points to one of Google’s servers Unleash your inner jQuery ninja today! 9 10 jQuery: Novice toNinja Obtaining the Latest Version with Google CDN If you look closely at the URL pointing to Google’s servers, you’ll see that the version of jQuery is specified by one of the path elements... inspiration to us all, and finally, my awesome Mum and Dad for getting me a Spectravideo 318 instead of a Commodore 64—thus forcing me to read the manuals instead of playing games, all those years ago Craig Sharkie Firstly, I’d like to thank Earle for bringing me onto the project and introducing me to the real SitePoint I’d met some great SitePointers at Web Directions, but dealing jQuery: Novice to Ninja. .. blossoming into an en cyclopedia of high quality tutorials, blog posts, and documentation 1 http://www.google.com/trends/ jQuery:NovicetoNinja (www.sitepoint.com) Falling in Love with jQuery What’s the downside? There barely is a downside! The main arguments against using any JavaScript library have always been speed and size: some say that using a library adds too much download bloat to pages, while... Whatever you choose, you’ll need to include jQuery in your HTML page, just as you would any other JavaScript source file Unleash your inner jQuery ninja today! 7 8 jQuery:NovicetoNinja It’s Just JavaScript! Never forget that jQuery is just JavaScript! It may look and act superficially different—but underneath it’s written in JavaScript, and consequently it’s unable to do anything that plain old JavaScript . . . 393
jQuery: Novice to Ninja (www.sitepoint.com)
Preface
No matter what kind of ninja you are—a cooking ninja, a corporate lawyer ninja, or.
an actual ninja ninja—virtuosity lies in first mastering the basic tools of the trade.
Once conquered, it’s then up to the full-fledged ninja to apply