Suppose I have a php script that returns employee details e.g name and address in json encoded format.
I loop through the data returned and print only their names out on a list, not needing to display other data on initial page load.
$.post( "./php/getEmployees.php",function( data ) {
$.each(data, function (index, value) {
$("#list").append('<li><a href="#section2">'+value.title+'</a></li>');
});
},"json");
Now I will have a list of employee names on screen for the user to see.
If they were to click on an employee I want to display the rest of their details that was returned in the getEmployees.php
script.
How would I store data from my script to be accessed later?