Editing, deleting, and rearranging pictures

Before we code, let's see how the edit, delete, and rearrange operations will work.

On clicking on the edit icon, a dialog box appears with the image name in a text box. The user will edit this name and click on the Save button. Clicking on the Save button will send an AJAX request to a PHP script. The album ID, picture ID, and edited name will be sent to this script. Depending on the album ID and picture ID, the PHP script will change the name of said image in the original albums.json file.

Similarly, to delete an image, we will send the album id and picture id to the PHP script. The PHP script will delete the image from the original albums.json file.

To rearrange the sequence of images, we will get the ...

Get Mastering jQuery UI now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.