0

ページの読み込み時に警告を表示するために、自分のサイトでSweet Alert t プラグインを使用しています。1回使ったらちゃんと動いたのに…

            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