Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PHP jQuery Cookbook

You're reading from   PHP jQuery Cookbook jQuery and PHP are the dynamic duo that will allow you to build powerful web applications. This Cookbook is the easy way in with over 60 recipes covering everything from the basics to creating plugins and integrating databases.

Arrow left icon
Product type Paperback
Published in Dec 2010
Publisher Packt
ISBN-13 9781849512749
Length 332 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vijay Joshi Vijay Joshi
Author Profile Icon Vijay Joshi
Vijay Joshi
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

PHP jQuery Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Handling Events with jQuery 2. Combining PHP and jQuery FREE CHAPTER 3. Working with XML Documents 4. Working with JSON 5. Working with Forms 6. Adding Visual Effects to Forms 7. Creating Cool Navigation Menus 8. Data Binding with PHP and jQuery 9. Enhancing your Site with PHP and jQuery Firebug Index

Inspecting elements


This recipe will introduce the HTML panel of Firebug and how it can be used to inspect the document structure, select an HTML element, and watch its CSS style.

How to do it...

  1. Open an HTML page, for example, http://www.google.com in your browser.

  2. Now click on the arrow icon from the Firebug bar and move your mouse pointer over any element on the page. The element will be highlighted and in the Firebug panel you will see details of that HTML element, as seen in the following screenshot:

  3. Another method, which is faster and more accurate, is to right-click on an element and click on Inspect Element on the context menu. Firebug will set the focus on the selected element.

How it works...

The HTML panel of Firebug is divided into two parts. The left panel shows the HTML whereas the right part shows the CSS styles. Clicking on the Inspect button allows us to inspect any element on the page. Moving the mouse pointer over any element will then display the element details in the HTML panel of Firebug. This panel displays the complete HTML of the document. This way we can see the complete structure of a page. There is one more advantage of inspecting elements in the HTML panel. It also shows the elements created after page load, that is, if you created any elements with jQuery or JavaScript, it will also show them in the HTML panel.

Once an element is selected, the right-hand side of Firebug shows its CSS styles whether defined in a stylesheet or created by a script.

There's more...

Plugins for firebug

Yes, you read that right. Firebug itself is a plugin, however, there are some other plugins that are very useful in rapid web development and are recommended to use with Firebug. Both of the tools listed next are useful in determining network activity, page performance, download time, and so on. Both of these provide a score of page performance against a set of rules and listed recommendations that can make page performance faster:

  • Google Page Speed: It is a plugin from Google. The following is its description from the Google site:

    Page Speed is an open-source Add-on for Firebug. Webmasters and web developers can use Page Speed to evaluate the performance of their web pages and to get suggestions on how to improve them.

    You can download Page Speed from the following URL: http://code.google.com/speed/page-speed/download.html.

  • Yahoo! YSlow: It is a plugin from Yahoo!, and can be downloaded from https://developer.yahoo.com/yslow/.

See also

  • The next recipe Editing HTML and CSS

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image