I am making a drag and drop tool in javascript. I have a collection of images that I can drag and drop into a grid. This grid has 3 rows and 20 columns.
When an image is dragged onto the grid I want to save this data. For example I drag image and drop it on row 1, column 2. How can I save this data in javascript ?
In php this would be:
<?php
// row 1, column 2
$savedItems[1][2] = array("image" => "testimage.jpg", "extra" => 1);
?>
This way I can check if there is already an image on that spot or not. Or if I want to change the options of the spot I can search in the $savedItems array.
But how could I save this data in javascript? So it is easy to add and search data in the array.