One thing we haven't discussed yet is the use of arrays. In the interface you are currently using, I have a Javascript file named setarrays in the script folder. That file contains all the array information for loading pages, displaying titles, page numbers and so on. The file itself is loaded into the interface via the importing JavaScript technique we discussed earlier.

In the gallery widget, more for the sake of conceptual ease than functionality, I have kept the arrays in the one function. Baby steps are good when learning this stuff. Later in part 2 of this tutorial, I will demonstrate how to load them dynamically using the methods we learned earlier.

For now I have added an extra case in the ajaxManager() function called array_setup. This case allows us to store information in arrays like so: