I have a problem. I want to pass String array to javascript, but this is impossible, so I want to convert String array to json and send it to java script. How can I do that?
Just convert use JSONArray,
import java.util.Arrays;
import org.json.JSONArray;
String[] inputs = new String[] {"foo", "bar"};
JSONArray jsonArray = new JSONArray(Arrays.asList(inputs));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With