mirror of
https://github.com/webui-dev/webui
synced 2025-03-28 21:13:17 +00:00
add example callback func
This commit is contained in:
parent
3c586b7c0b
commit
e34986cbf5
@ -78,21 +78,28 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<!-- WebUI Core -->
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function(event) {
|
||||
if (typeof _webui_ws === 'undefined'){
|
||||
let webui_searchParams = new URLSearchParams(window.location.search);
|
||||
if(webui_searchParams.has('webui')){
|
||||
let webui_url = webui_searchParams.get('webui');
|
||||
var webui_elem = document.createElement("script");
|
||||
webui_elem.type = "text/javascript";
|
||||
webui_elem.src = webui_url;
|
||||
document.getElementsByTagName('head')[0].appendChild(webui_elem);
|
||||
}
|
||||
else alert('Failed to get the WebUI Core link.');
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!-- WebUI Core ---------------------------------------------------->
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function (event) {
|
||||
if (typeof _webui_ws === "undefined") {
|
||||
let webui_searchParams = new URLSearchParams(window.location.search);
|
||||
if (webui_searchParams.has("webui")) {
|
||||
let webui_url = webui_searchParams.get("webui");
|
||||
var webui_elem = document.createElement("script");
|
||||
webui_elem.async = true;
|
||||
webui_elem.type = "text/javascript";
|
||||
webui_elem.src = webui_url;
|
||||
document.body.appendChild(webui_elem);
|
||||
} else alert("Failed to get the WebUI Core link.");
|
||||
}
|
||||
});
|
||||
// Callbacks
|
||||
function webui_ready() {
|
||||
|
||||
// WebUI is ready
|
||||
webui_debug(false);
|
||||
}
|
||||
</script>
|
||||
<!-- ------------------------------------------------------------ -->
|
||||
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user