Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在EpicEditor上设置动态值_Javascript_Html_Editor_Epiceditor - Fatal编程技术网

Javascript 在EpicEditor上设置动态值

Javascript 在EpicEditor上设置动态值,javascript,html,editor,epiceditor,Javascript,Html,Editor,Epiceditor,我用的是一个。下面是epiceditor初始化的代码: var opts = { container: 'epiceditor', textarea: null, theme: { base: '/themes/base/epiceditor.css', preview: '/themes/preview/github.css', editor: '/themes/editor/epic-light.css' },

我用的是一个。下面是epiceditor初始化的代码:

 var opts = {
    container: 'epiceditor',
    textarea: null,
    theme: {
        base: '/themes/base/epiceditor.css',
        preview: '/themes/preview/github.css',
        editor: '/themes/editor/epic-light.css'
    },
    basePath: '/epiceditor',
    clientSideStorage: false
}
var editor = new EpicEditor(opts);
editor.load();
我从数据库中获取了一些值,并希望在epicedior上显示这些值。我是epicEditor的新手,不知道该怎么做。有人能帮我吗!任何关于EpicEditor的专家

尝试将“textarea”属性设置为要将内容同步到EpicEditor的textarea字段id

我的配置如下所示:

var opts = {
    container: 'epiceditor',
    textarea: null,
    basePath: 'epiceditor',
    clientSideStorage: true,
    localStorageName: 'epiceditor',
    useNativeFullscreen: true,
    parser: marked,
    file: {
        name: 'epiceditor',
        defaultContent: '',
        autoSave: 100
    },
    theme: {
        base: '/themes/base/epiceditor.css',
        preview: '/themes/preview/preview-dark.css',
        editor: '/themes/editor/epic-dark.css'
    },
    button: {
        preview: true,
        fullscreen: true
    },
    focusOnLoad: false,
    shortcut: {
        modifier: 18,
        fullscreen: 70,
        preview: 80
    },
    string: {
        togglePreview: 'Toggle Preview Mode',
        toggleEdit: 'Toggle Edit Mode',
        toggleFullscreen: 'Enter Fullscreen'
    }
}
var editor = new EpicEditor(opts);

您可以查看更多API。

谢谢Manish!太好了!