Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #112994
    natejacobson
    Participant

    Is there a way to load remote content dynamically in Smart Editor using web?

    #113028
    Markov
    Keymaster

    Hi,

    yes, this is possible.

    <smart-editor id="editor"></smart-editor>
    
    <script>
        window.onload = async () => {
            const editor = document.getElementById('editor');
    
            // Load remote content
            const response = await fetch("https://example.com/article.html");
            const html = await response.text();
    
            // Set the HTML content inside the editor
            editor.value = html;
        };
    </script>

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.