Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: "http://localhost:8080/spatial/getRequestTypes",
- type: "POST",
- dataType: "text",
- contentType: "application/json",
- success: function (response) {
- console.log("loaded");
- let obj = $.parseJSON(response);
- let html_radioButtons = "";
- for (let i = 0; i < obj.length; i++) {
- if (i === 0) {
- html_radioButtons += "<div style=\"display: inline-block\"><input class=\"with-gap\" type=\"radio\" id=\"radio0" + (i + 1) +
- "\" checked value=\"" + obj[i] + "\" name=\"group1\"/>" +
- "<label for=\"radio0" + (i + 1) + "\"><span></span>" + obj[i].toUpperCase() + "</label></div>";
- } else {
- html_radioButtons += "<div style=\"display: inline-block\"><input class=\"with-gap\" type=\"radio\" id=\"radio0" + (i + 1) +
- "\" value=\"" + obj[i] + "\" name=\"group1\"/>" +
- "<label for=\"radio0" + (i + 1) + "\"><span></span>" + obj[i].toUpperCase() + "</label></div>";
- }
- }
- $("#requestType").html(html_radioButtons);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement