微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

自动保存/定时保存的 HTML 问题

如何解决自动保存/定时保存的 HTML 问题

我根本不熟悉 html 并且有点卡住了。我将以下代码粘贴到 FileMaker 数据库程序中,并希望将自定义按钮转换为每 1 或 2 秒发生一次的定时函数。 或者甚至......如果有一种方法可以从 FileMaker 查询函数,这样我就可以在 FileMaker 数据库中放置一个按钮(发送按钮),因为用户希望将其作为布局。

nb - 我已经注释掉了一些按钮,因为我不确定我是否还在使用它们。

提前致谢!

<html lang="en">
<head>
    <Meta charset="UTF-8">
    <title>HTML Editor</title>
    <!-- include libraries(jQuery,bootstrap) -->
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <!-- include summernote css/js -->
    <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.16/dist/summernote.min.js"></script>
    <!--  <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" rel="stylesheet">
      <link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.11/summernote.css" rel="stylesheet"> -->

    <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.16/dist/summernote.min.css" rel="stylesheet">
    <link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div id="summernote">[[CONTENT]]</div>
<script>

    // add a 'Save' button to the toolbar
    var SaveButton = function (context) {
        var ui = $.summernote.ui;

        // create button
        var button = ui.button({
            contents: 'Send',tooltip: 'Save changes',click: function () {
                //$('#summernote').summernote('code','code');
                //window.alert('save changes');
                /* Prep the URL to use for the hand-off to FM. */
                var fullURL = '[[SAVEURL]]&param=' + encodeURIComponent ($('#summernote').summernote('code'));
                /* Send the data to FM. */
                window.location = fullURL;
                return false;
            }
        });
        return button.render();   // return button as jquery object 
    }


    $(document).ready(function() {
        $('#summernote').summernote({
            height: 300,tabsize: 2,toolbar: [
                // [groupName,[list of button]]
                ['style',['style','bold','italic','underline','clear']],//['font',['strikethrough','superscript','subscript']],//['fontsize',['fontsize']],['color',['color']],//['para',['ul','ol','paragraph']],//['height',['height']],['insert',['link']],//['insert',['link','hr','table']],//['misc',['codeview']],['mybutton',['save']]
            ],buttons: {save: SaveButton}
        });
    });


</script>
</body>
</html>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。