function LoadEmployees() {
var ul = $("#employees");
ul.empty();
$.ajax({
method: "GET",
url: "../api/employee/employeelist"
}).done(function (response) {
// console.log(response);
if (response == null) return;
for (var i = 0; i < response.length; i++) {
var emp = response[i];
var li = $(" <li class='list-group-item' id="+emp.id+">" + emp.id+" " + emp.Name + " " + emp.Surname +
"(Cinsiyet:" + emp.Gender + " Maaş : " + emp.Salary + "$)</li>")
.click(function() {
//。しかし、今、私は模倣した模様に基づいてコンボボックスを設定するように祈っています。私は更新しました
$('#name').val(response[$(this).index()].Name);
$('#surname').val(response[$(this).index()].Surname);
$('#gender').val(response[$(this).index()].Gender);
$('#salary').val(response[$(this).index()].Salary);
// alert($(this).html()); // gets innerHTML of clicked li
// alert(this.id);
});
ul.append(li);
}
}).fail(function() {
alert("Hata oluştu.")
});
}
リモートサイトだけでなく、ここにコードを投稿してください。 [Stack Snippets](https://stackoverflow.blog/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/)を使用して実行可能にすることができます。 – Barmar
'.html()'は文字列を返します。 '.name'はそれから何を返すと思いますか? – Barmar
'String.prototype.split'を使うと、文字列をスペースで区切られた単語に分割することができます。あるいは、正規表現を使ってより複雑なパターンを解析することもできます。 – Barmar