profile
viewpoint

Ask questionsjquery initialization not working when using CDN files

Version

1.4.6

Test Environment

Mac OS, Version: 76.0.3809.100

Current Behavior

When I refer the CDN files, I can initialise the editor correctly with the usual javascript initialisation, but the jquery initialisation fails. I have included jquery 3.3.1 too.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<link rel="stylesheet" href="https://uicdn.toast.com/tui-editor/latest/tui-editor.css"></link>
<link rel="stylesheet" href="https://uicdn.toast.com/tui-editor/latest/tui-editor-contents.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css"></link>
<script src="https://uicdn.toast.com/tui-editor/latest/tui-editor-Editor-full.js"></script>

<div id="editSection"></div>

<script language="JavaScript">
   var editor = new tui.Editor({
        el: document.querySelector('#editSection'),
        initialEditType: 'markdown',
        previewStyle: 'vertical',
        height: '300px'
    });  //Works Fine

    $(document).ready(function () {
        $('#editSection').tuiEditor({
            initialEditType: 'markdown',
            previewStyle: 'vertical',
            height: '300px'
        });
    }); // Fails

</script>

The error is : jquery.js:3827 Uncaught TypeError: $(...).tuiEditor is not a function

How do I initialise via jquery?

nhn/tui.editor

Answer questions jaydeepk

Thanks @seonim-ryu

useful!

Related questions

Viewer not working with CDN hot 1
source:https://uonfu.com/
Github User Rank List