13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Adding Ajax Elements to Earlier Projects<br />

883<br />

Figure 34.9<br />

Attempting to add a bookmark that already exists.<br />

Additional Changes to <strong>PHP</strong>bookmark<br />

Changing the bookmark addition functionality to an Ajax-enabled user interface is just<br />

the first of many changes you could make to this application.The next logical choice<br />

might be the bookmark deletion functionality.The process might go something like this:<br />

n Remove the Delete BM link from the page footer.<br />

n Invoke a new JavaScript function when the user checks the Delete? check box<br />

next to a bookmark.<br />

n Modify the delete_bm.php script so that it can be invoked by the new JavaScript<br />

function, complete the deletion process, <strong>and</strong> return a message to the user.<br />

n Make any additional modifications to the functionality to ensure that actions occur<br />

<strong>and</strong> messages are displayed appropriately within the new user interface.<br />

With the structure already in place for these changes, you should be able to make them<br />

just with the information provided in this chapter. However, the following sections provide<br />

links to resources containing much more information on creating Ajax-enabled<br />

sites.<br />

Remember, Ajax is a set of technologies that work together to create a more fluid<br />

user experience; this often necessitates rethinking an application from the ground up<br />

now that you know what you can do when all the puzzle pieces fall into place.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!