News Feed

News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

IBM developerWorks:
Developing PHP the Ajax way, Part 2 - Back, Forward, Reload
June 08, 2006 @ 06:04:23

IBM developerWorks has posted the second part of their series covering the development of PHP and Ajax to create a photo gallery application. In this part, they work off of the gallery already created in part one, taking care of one issue that plagues Ajax application - the breaking of the back button.

A major challenge of Asynchronous JavaScript and XML (Ajax)-driven Web sites is the lack of a Back button. We will use JavaScript to create a history stack for the Ajax photo gallery built in Part 1 of this two-part "Developing PHP the Ajax way" series. This history stack will closely mirror the history utility found in Web browsers, and it will be used to provide Back, Forward, and Reload buttons for the application.

They start with a look at what it means to "save state" in the browser, including the use of the Back button to navigate between pages. Seeing that Ajax breaks this, they move ahead with a simple solution - creating an internal history stact for the application and use its own navigation methods. They provide some examples images to use and all of the code you'll need to accomplish this.

They create a class using the popular Prototype javascript library to create functions like do_add, do_back, and do_forward to correctly handle the adding and deleting of the items from the stack. Once that script is developed, they take and integrate it back with the photo gallery from part one.

0 comments voice your opinion now!
ajax developing tutorial part2 photo gallery back button history ajax developing tutorial part2 photo gallery back button history

blog comments powered by Disqus

Similar Posts

Daniel Cousineau's Blog: Hierarchical Data With PHP and MySQL Login with Instagram OAuth using PHP 10 Easy Solutions for PHP String Manipulation

HowTo Forge: Multisite CVS Drupal Installation on Ubuntu Understanding and Applying Polymorphism in PHP

Community Events

Don't see your event here?
Let us know!

laravel5 framework interview api community podcast php7 example extension release opinion version list unittest laravel voicesoftheelephpant language series library introduction

All content copyright, 2015 :: - Powered by the Solar PHP Framework