Testing jQuery


In the first part of this book, you’ll be getting familiar with the history and basic



Download 8,12 Mb.
Pdf ko'rish
bet18/201
Sana29.12.2021
Hajmi8,12 Mb.
#81984
1   ...   14   15   16   17   18   19   20   21   ...   201
Bog'liq
Pro PHP And Jquery

In the first part of this book, you’ll be getting familiar with the history and basic 
capabilities of jQuery. By the end of this section, you will have a general grasp on the 
overarching concepts behind jQuery, and—after you’ve revisited object-oriented PHP 
in Part 2—you’ll be ready to tackle the exercises in Part 3 (where you actually start 
building a real-world project with jQuery and PHP). 
www.freepdf-books.com


 
www.freepdf-books.com


C H A P T E R  1 
 
■ ■ ■ 
 

Introducing jQuery 
To fully understand jQuery and its applications in modern web programming, it's important to take a 
moment and look back at where jQuery came from, what needs it was built to fill, and what 
programming in JavaScript was like before jQuery came around.  
In this chapter you'll learn about JavaScript libraries and the needs they seek to fulfill, as well as why 
jQuery is the library of choice for the majority of web developers. You'll also learn the basics of jQuery, 
including how to make the library available for use in your applications and how the core of jQuery—its 
powerful selector engine—works. 
Choosing jQuery over JavaScript 
JavaScript has a reputation for being rather unwieldy in web applications. A lack of consistent browser 
support, difficult debugging, and an intimidating syntax can make learning JavaScript feel impossible. 
To be fair, all the things that make JavaScript seem difficult are part of what make it so powerful, but 
that doesn't make it any more inviting to a novice web developer looking to add JavaScript to his arsenal. 
Understanding JavaScript Libraries 
The steep learning curve associated with JavaScript has been a sore spot for developers for years, and as 
frustrations grew, several ambitious developers started building JavaScript libraries, also referred to as 
JavaScript frameworks. 
These libraries aimed to simplify the use of JavaScript to make it more accessible to both new and 
existing developers by creating easy-to-use control functions that remove some of the heavy lifting from 
everyday JavaScript tasks. Libraries are especially useful in the realm of Asynchronous JavaScript and 
XML (AJAX) due to the complexity of performing the same tasks using straight JavaScript. 
JavaScript libraries aim to provide a simpler syntax for common tasks, which translates to a faster 
workflow for developers and a less intimidating learning curve for beginners. They also eliminate some 
of the headache involved in coding cross-browser JavaScript by doing all the compatibility checks for 
you within their built-in methods, which is a huge time-saver when coding. 
www.freepdf-books.com


CHAPTER 1 

 INTRODUCING JQUERY 
 


 Note The difference between using jQuery's AJAX tools versus the straight JavaScript method will be explored 
later on in Chapter 2. 
A good number of JavaScript libraries are available. Several of the most popular currently in use are 
Prototype (http://www.prototypejs.org), MooTools (http://mootools.net), Yahoo! UI Library 
(http://developer.yahoo.com/yui), and the focus of this book, jQuery. 
Understanding the Benefits of jQuery 
Every JavaScript framework has its own benefits; jQuery is no exception, providing the following 
benefits: 
•  Small file size (approximately 23KB as of version 1.4) 
•  Extremely simple syntax 
•  Chainable methods 
•  Easy plug-in architecture for extending the framework 
•  A huge online community 
•  Great documentation at http://api.jquery.com 
•  Optional extensions of jQuery for added functionality, such as jQueryUI 
Understanding the History of jQuery 
The brain child of developer John Resig jQuery was first announced at BarCamp NYC in early 2006 (for 
more on BarCamp, see http://barcamp.org). Resig noted on his web site, that he created jQuery because 
he was unhappy with the currently available libraries and felt that they could be vastly improved by 
reducing “syntactic fluff” and adding specific controls for common actions 
(http://ejohn.org/blog/selectors-in-javascript/). 
jQuery was a big hit in the development community and quickly gained momentum. Other 
developers came on to help refine the library, ultimately resulting in the first stable release of jQuery, 
version 1.0, on August 26, 2006. 
Since then, jQuery has progressed to version 1.4.2 (at the time of this writing) and has seen a huge 
influx of plug-ins from the development community. A plug-in is an extension of jQuery that isn’t part of 
the core library. You'll learn more about (and build) jQuery plug-ins in Chapter 10. 
Setting Up a Testing Environment 
Because there’s no better way to understand a new language than to just get your hands dirty, you’ll 
need a testing environment to try out some introductory exercises with jQuery. Fortunately, setting up 
this testing environment is a simple two-step process: install Firefox, and install Firebug. 
www.freepdf-books.com


CHAPTER 1 
■ 
INTRODUCING JQUERY 
 

Throughout this book, all exercises will assume that you are using the Firefox browser with the 
Firebug plug-in due to its excellent JavaScript testing console. 
Installing Firefox 
To get Firefox up and running on your computer, navigate to http://firefox.com and download the 
latest version of Firefox (version 3.6 at the time of this writing). After running the installer (Firefox Setup 

Download 8,12 Mb.

Do'stlaringiz bilan baham:
1   ...   14   15   16   17   18   19   20   21   ...   201




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish