Received dynamic data from the server is shown below:
{
"data": [
{
"id": 4,
"first_name": "Eve",
"last_name": "Holt",
"lat":"25.6599899",
"lng":"45.3664646",
"status":"0"
},
{
"id": 5,
"first_name": "Charles",
"last_name": "Morris",
"lat":"25.99899",
"lng":"45.4646",
"status":"1"
},
{
"id": 6,
"first_name": "Tracey",
"last_name": "Ramos",
"lat":"25.2339899",
"lng":"45.56664646",
"status":"1"
}
]
}
To create dynamic buttons based on the status value, if status=1 and there are 3 members with that status, then 3 buttons will be created with their respective names and IDs. When a user clicks any button, an alert displaying the name and details of that person will appear.