-2

このコードを編集して、無効になっている右クリックとコンテキスト メニューを再度有効にするにはどうすればよいですか? JavaScript やその他のバックエンド言語についての知識はありません。このコードは、私の大学の javaelab Web サイトからのもので、右クリックとコピー ペーストが無効になっています。

$.ajax({
        type: 'POST',
        url: '../flag.checker.php',
        success: function(codedata) {
            if(codedata == 1) {
             console.log("Diasble");

                $("body").on("contextmenu",function(e){
                   window.alert("NOT ALLOWED");
                    return false;
                });

                $('body').bind('cut copy paste', function (e) {
                    e.preventDefault();
                    window.alert("NOT ALLOWED");
                     return false;
                });

                editor.on('paste',function(e){
                    e.preventDefault();
                    console.log('Paste is clicked');
                });


                editor.on('beforeChange',function(instance,changeObj) {
                    if(changeObj.origin == "paste") {
                        window.alert("NOT ALLOWED");
                        changeObj.cancel();
                    }
                });
            }
        }

    });
4

2 に答える 2