-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (18 loc) · 700 Bytes
/
Copy pathindex.js
File metadata and controls
21 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let firmware_Select = document.getElementById('firmwareSelect');
let downloadInfo = document.getElementById('installationInfo');
function clck(){
let selectedOption = firmware_Select.value;
fetch('index.json')
.then(response => response.json())
.then(data => {
downloadInfo.innerHTML = data[selectedOption];
load('https://unpkg.com/esp-web-tools@9.1.1/dist/web/install-button.js?module');
});
}
function load(file) {
let src = document.createElement('script');
src.setAttribute("type", "module");
src.setAttribute("src", file);
document.getElementsByTagName('head')[0].appendChild(src);
}
firmware_Select.addEventListener('change', clck);