Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying jQuery 1.3 with PHP
  • Table Of Contents Toc
jQuery 1.3 with PHP

jQuery 1.3 with PHP

By : Kae Verens
4.5 (6)
close
close
jQuery 1.3 with PHP

jQuery 1.3 with PHP

4.5 (6)
By: Kae Verens

Overview of this book

To make PHP applications that respond quickly, avoid unnecessary page reloads, and provide great user interfaces, often requires complex JavaScript techniques and even then, if you get that far, they might not even work across different browsers! With jQuery, you can use one of the most popular JavaScript libraries, forget about cross-browser issues, and simplify the creation of very powerful and responsive interfaces ñ all with the minimum of code. This is the first book in the market that will ease the server-side PHP coder into the client-side world of the popular jQuery JavaScript library. This book will show you how to use jQuery to enhance your PHP applications, with many examples using jQuery's user interface library jQuery UI, and other examples using popular jQuery plugins. It will help you to add exciting user interface features to liven up your PHP applications without having to become a master of client-side JavaScript. This book will teach you how to use jQuery to create some really stunning effects, but without you needing to have in-depth knowledge of how jQuery works. It provides you with everything you need to build practical user interfaces for everything from graphics manipulation to drag-and-drop to data searching, and much more. The book also provides practical demonstrations of PHP and jQuery and explains those examples, rather than starting from how JavaScript works and how it is different from PHP. By the end of this book, you should be able to take any PHP application you have written, and transform it into a responsive, user-friendly interface, with capabilities you would not have dreamed of being able to achieve, all in just a few lines of JavaScript.
Table of Contents (16 chapters)
close
close
jQuery 1.3 with PHP
Credits
About the Author
About the Reviewers
Preface
1
Index

JavaScript optimizations


The Javascript optimization tricks are not specific to jQuery, but are very good to know.

Chaining

Chaining means running a number of functions on a selected element or group of elements.

Consider what happens when you do this:

$('.someclass').click(function(){
  alert('clicked');
}); 
$('.someclass').css('background','red'); 
$('.someclass').text('some text'); 

On each line, jQuery is called with a fresh request to get all elements with the class name someclass and manipulate them in some way. This is quite expensive to do, as jQuery does not automatically cache the requests, so it's a fresh search every time.

To speed this up, you should chain the functions like this:

$('.someclass').click(function(){
  alert('clicked');
}) 
.css('background','red') 
.text('some text'); 

This runs the selector search once, and then runs all three operations on the same object.

Speeding up selectors

Another thing to watch out for is the selector itself. Some types of selector run quicker...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
jQuery 1.3 with PHP
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon