Posted by adminApril 19, 2011jQuery

jQuery and LAMP – A Great Match

Author: Michael Dorf

Many LAMP developers traditionally prefer to shy away from heavy JavaScript utilization unless absolutely necessary, but jQuery opens up a variety of options that alleviate most of the former’s complexity. As a lightweight JavaScript library, jQuery can help solve many front end (view) coding challenges involved in meeting Web 2.0 design demands and cloud computing scale requirements. By design, the library can integrate seamlessly into the front end of applications with selectors tied to common coding elements to simplify presentation.

jQuery is by no means a newcomer to the industry. Since its release in 2006, the open source library has gradually gained reputation as an essential (and often “de facto”) front-end framework for dynamic navigation, rich media content and AJAX integration. In an environment where HTML5 and CSS3 are emerging as primary standards for both the desktop and mobile web, jQuery can provide an invaluable tool leveraging the best practices of document object modeling.

Working with jQuery in LAMP Applications
With its streamlined code and lightweight design (just under 80 KB in its “minified” edition), the script can add functionality to PHP applications with a minimal footprint. Adding the script to the header of your primary HTML section can help to retain fast load times and agile coding standards, even as you work to meet client requirements.

Developers are often challenged to keep applications lightweight while meeting brand standards and designer requests. jQuery provides a seamless bridge between the world of drawing boards, Adobe Illustrator and developer resource constraints. Even if you have avoided JavaScript in the past, it is worth considering investing in jQuery integration to get Web 2.0 design benefits using limited resources. Adobe Flash and Microsoft Silverlight may provide attractive visuals but an integrated LAMP design with jQuery can improve load times, cross-browser compatibility and solve a variety of development challenges.

A Basic Use of jQuery
Functions within jQuery are bound by events and can be linked to CSS classes or HTML selectors by making calls to the jQuery API:

jQuery(document).ready(function() { jQuery(“a”).click(function(event) { alert(“Thanks for your submission!”); }); });

When triggered by an action, a wide variety of functions can be implemented with unique CSS or HTML object manipulation via the simple-to-use jQuery method calls. This allows you to add interactivity to your application without requiring large-scale images or Flash. As tablets and netbooks increasingly rely upon HTML as their standard language for rich media, jQuery becomes an essential toolkit for the LAMP arsenal.

A common implementation of jQuery can be seen where a user needs to remove an element after a basic interaction. One example of this might be removing a registration box after the user completes the form (with AJAX submission). All that is required is defining a couple of basic CSS classes and a jQuery function call that fades the registration box after a submit button has been clicked.

Beyond this basic implementation, jQuery libraries can handle nearly any type of front end animation or presentation demand. In a world where developers are required to render complex designs in a cross-platform setting, jQuery answers the call with authority.

Article Source: http://www.articlesbase.com/web-design-articles/jquery-and-lamp-a-great-match-4514135.html

About the Author

Michael Dorf is a professional software architect and instructor with a M.S. in Software Engineering and 12 years of industry experience. He teaches for LearnComputer! (learncomputer.com), which offers public and onsite instructor-led PHP, Ajax and jQuery Training courses. Whether you prefer to sign up for our jQuery training or just read an article on best PHP books, you will find many useful resources on our website.

Tagged In

Comments are closed