Skip to content

Commit

Permalink
update serve a folder example
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhongjia committed Jan 6, 2024
1 parent dbf68e3 commit 70898e9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/examples/serve_a_folder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,18 @@ <h4><a href="dynamic.html">Dynamic file example (Embedded)</a></h4>
xmlHttp.send(null);
alert(xmlHttp.responseText);
}

document.addEventListener("DOMContentLoaded", function () {
// DOM is loaded, and `webui` object should be available.
webui.setEventCallback((e) => {
if (e == webui.event.CONNECTED) {
// Connection to the backend is established
console.log("Connected.");
} else if (e == webui.event.DISCONNECTED) {
// Connection to the backend is lost
console.log("Disconnected.");
}
});
});
</script>
</html>

0 comments on commit 70898e9

Please sign in to comment.