diff options
-rw-r--r-- | res/default.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/res/default.js b/res/default.js index 3cc642d..42ad358 100644 --- a/res/default.js +++ b/res/default.js @@ -29,6 +29,7 @@ function open_timetable() { function onload() {
$.getJSON("content/content.json", function(data){
+ var el = $("#sidebar")[0];
data.forEach((item)=>{
var load = item.load;
var url = item.url;
@@ -55,8 +56,8 @@ function onload() { atag.appendChild(texttag);
atag.classList.add('button');
atag.classList.add('sidebar-button');
- $("#sidebar").appendChild(atag);
+ el.appendChild(atag);
});
- $("#sidebar").lastChild.classList.add('sidebar-last');
+ el.lastChild.classList.add('sidebar-last');
});
}
|