質問編集履歴
1
ソースの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
<body>
|
52
52
|
|
53
|
-
|
53
|
+
<input id="search" type="button" value="検索" />
|
54
54
|
|
55
55
|
<div id="jstree"></div>
|
56
56
|
|
@@ -58,31 +58,59 @@
|
|
58
58
|
|
59
59
|
<script type="text/javascript">
|
60
60
|
|
61
|
-
$(function
|
61
|
+
$('#search').click(function() {
|
62
62
|
|
63
63
|
let hostUrl = "http://localhost:3000/hits";
|
64
64
|
|
65
|
-
$
|
65
|
+
$.ajax({
|
66
66
|
|
67
|
-
|
67
|
+
type: 'get',
|
68
68
|
|
69
|
-
|
69
|
+
url: hostUrl,
|
70
70
|
|
71
|
-
|
71
|
+
dataType : 'json'
|
72
72
|
|
73
|
-
|
73
|
+
}).done(function(data){
|
74
74
|
|
75
|
-
|
75
|
+
console.log("success");
|
76
76
|
|
77
|
-
|
77
|
+
$(function () {
|
78
78
|
|
79
|
-
|
79
|
+
let hostUrl = "http://localhost:3000/hits";
|
80
80
|
|
81
|
-
|
81
|
+
$('#jstree').jstree({
|
82
82
|
|
83
|
-
|
83
|
+
'core' : {
|
84
84
|
|
85
|
+
'url' : hostUrl, // ajaxで読み込むjsonファイル
|
86
|
+
|
87
|
+
'dataType' : 'json',
|
88
|
+
|
89
|
+
'data' : function(node) {
|
90
|
+
|
91
|
+
return {'id': node.id };
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
)}
|
100
|
+
|
85
|
-
);
|
101
|
+
);
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
}).fail(function(){
|
106
|
+
|
107
|
+
alert('データが無いです');
|
108
|
+
|
109
|
+
$('#zip').val("");
|
110
|
+
|
111
|
+
});
|
112
|
+
|
113
|
+
});
|
86
114
|
|
87
115
|
|
88
116
|
|