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 PHP Ajax Cookbook
  • Table Of Contents Toc
PHP Ajax Cookbook

PHP Ajax Cookbook

By : Milan Sedliak
4 (5)
close
close
PHP Ajax Cookbook

PHP Ajax Cookbook

4 (5)
By: Milan Sedliak

Overview of this book

This book contains a collection of recipes with step-by-step directions to build SEO-friendly websites using standard Ajax tools. Each recipe contains behind-the-scene explanations to PHP Ajax questions. This book is an ideal resource for people who like to add Ajax features to websites and who prefer standards and best practices for building SEO-friendly websites. As the book covers advanced topics, readers need to be aware of basic PHP, JavaScript and XML features.
Table of Contents (16 chapters)
close
close
PHP Ajax Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1
Index

Triggering JavaScript early/on DOM load


In Web 2.0 websites that have containers and animations, we'd want the JavaScript code to get executed as quickly as possible, so that the users won't see a flickering effect when we apply hide, show, or animation effects. Also, when we handle any events through JavaScript or JavaScript frameworks, we'd want the events such as click, change, and so on get applied to the DOM as quickly as possible.

Getting ready

Earlier, JavaScript developers mixed JavaScript and HTML together. This practice is called inline scripting. As the Web was evolving, more standards and practices came up. Unobtrusive JavaScript practice generally means that JavaScript code is separated from markup code and JavaScript is handled in an unobtrusive manner.

Here's some quick code written to alert the user with the message Enter your name!, when the name field is clicked:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd...
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.
PHP Ajax Cookbook
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