剑道弹出加载html内容

这是我的剑道弹出脚本,它工作得很好。但我想对它做一点小改动。


<!DOCTYPE html>

<html>

<head>

    <title></title>

    <link rel="stylesheet" href="styles/kendo.common.min.css" />

    <link rel="stylesheet" href="styles/kendo.default.min.css" />

    <link rel="stylesheet" href="styles/kendo.default.mobile.min.css" />


    <script src="js/jquery.min.js"></script>



    <script src="js/kendo.all.min.js"></script>



</head>

<body>

<div id="example">

    <div id="dialog">

    </div>

    <span id="undo" style="display:none" class="k-button hide-on-narrow">Click here to open the dialog</span>

</div>

<script>

    $(document).ready(function () {

        var dialog = $('#dialog'),

            undo = $("#undo");


        undo.click(function () {

            dialog.data("kendoDialog").open();

            undo.fadeOut();

        });


        function onClose() {

            undo.fadeIn();

        }


        dialog.kendoDialog({

            width: "450px",

            title: "Software Update",

            closable: false,

            modal: false,

            content: "<p>A new version of <strong>Kendo UI</strong> is available. Would you like to download and install it now?<p>",

            actions: [

                { text: 'Skip this version' },

                { text: 'Remind me later' },

                { text: 'Install update', primary: true }

            ],

            close: onClose

        });

    });

</script>

<style>

    #example {

        min-height: 350px;

    }

</style>



</body>

</html>

正如您在脚本中看到的那样,有一部分说内容:"<p>A new version of <strong>Kendo UI</strong> is available. Would you like to download and install it now?<p>",我不想在这里有一个修复文本,我想加载一个名为 Terms.html 的 HTML 文件的内容。


感谢你的帮助。


婷婷同学_
浏览 73回答 1
1回答

饮歌长啸

您可以通过url以下方式完成content:dialog.kendoDialog({&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: "450px",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title: "Software Update",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; closable: false,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; modal: false,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content&nbsp; : {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url: "Terms.html"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; actions: [&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { text: 'Skip this version' },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { text: 'Remind me later' },&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { text: 'Install update', primary: true }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; close: onClose&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript