0

我在我的网站上使用Sweet Aler t 插件,以在加载页面时显示警告。当我使用它一次时,它可以正常运行...

            swal({
                title: "Security Notice",
                text: "This site uses cookies to enhance your experience.\nBy continuing to use this site you are agreeing to the use of said cookies.\n\nPlease note; Your IP will also be recorded if you make a post.\nThis is for security measures only.",
                allowOutsideClick: "false",
                confirmButtonText: "Accept!"
            },
                function() {
                    $.cookie('allow_cookies', '1', { expires: 160, path: '/' });
                    });
                }
            );

这非常有效。但是当我添加另一个swal功能时,它打破了它。第一个警报仍然有效。这是新代码,是造成麻烦的代码。

            swal({
                title: "Security Notice",
                text: "This site uses cookies to enhance your experience.\nBy continuing to use this site you are agreeing to the use of said cookies.\n\nPlease note; Your IP will also be recorded if you make a post.\nThis is for security measures only.",
                allowOutsideClick: "false",
                confirmButtonText: "Accept!"
            },
                function() {
                    $.cookie('allow_cookies', '1', { expires: 160, path: '/' });

                    //The following was added, which then caused trouble.

                    swal({
                        title: "Profanity Notice",
                        text: "The guestbook is open to public use,\nAnd so can be subject to obscene language and images.\n\n If you see such text/images, please report it to:\n<a href=\"mailto:abuse@my-coding.com?Subject=MyCoding%20Guestbook%20Abuse\" target=\"_top\">abuse@my-coding.com</a>",
                        allowOutsideClick: "false",
                        html: "true",
                        confirmButtonText: "Accept!"
                    }); //end of the new added code.

                }
            );

我希望它是愚蠢的,比如错过了分号或括号,但我自己找不到任何东西。

4

0 回答 0