javascript附加多个选项以进行选择
我试图发送多个file.getPath()
来在select中创建选项(在本例中为4)
但是我把所有的东西都放在一行:http://prntscr.com/hjwtsd
有什么问题吗
爪哇
List<GitlabRepositoryTree> files = GitLab.getBranchFiles(project,branch);
for (GitlabRepositoryTree file : files) {
response.getWriter().write(file.getPath());
}
HTML
<select id="file" class="form-control" name="file">
<%-- JQUERY --%>
</select>
JQUERY
success: function (file) {
$('#file').empty();
$('#file').append($("<option/>", {
value: file,
text: file
}));
}
共 (0) 个答案