如何編輯這段代碼,以便右鍵單擊和已禁用的上下文菜單被重新啓用?我不知道JavaScript或任何其他後端語言。這段代碼來自我大學的javaelab網站,他們禁用了右鍵單擊和複製粘貼。編輯javascript代碼以啓用右鍵單擊並在網頁上覆制粘貼
$.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();
}
});
}
}
});
你要編輯該代碼或添加其他代碼來阻止那些影響? – Mouneer