Skip to content

Berry web_handler added, how to auto-update page #21659

Discussion options

You must be logged in to vote

To make an auto-update I added the following java script to the created web-page:

<script>
        // Shortened form for document.getElementById - but is already included from tasmota, so no need to add again.
        //const eb = s => document.getElementById(s);

        // Function to fetch data via AJAX
        function fetchData() {
            // Create a new XMLHttpRequest object
            const xhr = new XMLHttpRequest();

            // Define what happens when the request is successful
            xhr.onreadystatechange = () => {
                if (xhr.readyState === 4 && xhr.status === 200) {
                    // Process the response data
                    const data = JS…

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sfromis
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sfromis
Comment options

Comment options

You must be logged in to vote
2 replies
@sfromis
Comment options

@MechatronikMonkey
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MechatronikMonkey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants