So, I have the following js function:
var name_list = names; //mike,steve,sean,roger jQuery.ajax({ type: "GET", url: custom.ajax_url, dataType: 'html', data: ({ action: 'some_function', name_list:name_list}), success: function(data){ alert('success') });
There is a variable that stores an array of values ββ("mike, steve, sean, roger" separately by a comma).
Now I want to use the first value to call ajax (name_list = mike), and as soon as this is done, I want to repeat the same ajax call with the second value (name_list = steve).
Here is my question.
How to use an individual value in a variable and use only the subsequent value when the function (ajax call) is successful?
Thanks!
source share