为什么即使删除并保存该代码也仍会在我的代码中显示?

问题描述

此特定代码行不断出现在此文件const { clean } = require("underscore");中,它是该文件的顶部。我什至删除并保存了它,以后还会再来。在链接到该文件的其他文件中也可以。我与此行相关的唯一一件事是一个名为clean.js的文件,该文件只是删除我的文本,按钮和内容的功能。

function clear() {

  $('.texts').remove();

  $('.buttons').remove();

  $('.lines').remove();

  $('.brs').remove();

  $('.e-buttons').remove();

  $('.centers').remove();

};

有人知道为什么会这样吗?也许与Jquery数据库有关?

const { clean } = require("underscore");

var Dif = '';

function download(filename,text) {
    var pom = document.createElement('a');
    pom.setAttribute('href','data:text/plain;charset=utf-8,' + encodeURIComponent(text));
    pom.setAttribute('download',filename);
    pom.click();
};

function Systems(core) {

    if (core == 'Main_Menu') {

        clear();

        $("<p class='texts' >This is a main menu,please pick New Game,Save Game,Load Game,or Options.</p>").insertBefore("#placeholder");

    }

    else if (core == 'Save') {

        download ('Files/Address.txt','You are ' + gender + ',by the name of ' + pn + ',and you claim to be a ' + OBG + '.');
        //add a way for player to change Files/Address.txt into what they want by use input,then attach that to variable and then use that variable to replace the name of file in download format above this comment.
    
        console.log("save complete successful!");
    
    }

    else if (core == 'Option') {

        clear();

        $('<center class=\'centers\'><button class=\'command_button d-buttons\' value=\'difficulty\'>Difficulty</button></center><br class=\'brs\'>').insertBefore('#placeholder_choice');

    }

};

$(document).on('click','.d-buttons',function() {

    var button = $(this).val();
    console.log('The Button is ' + button);
    $('#console').scrollTop($('#console')[0].scrollHeight);

    if (button == 'difficulty') {

        clear();

        $('<center class=\'centers\'><button class=\'command_button d-buttons\' value=\'easy\'>Easy</button></center><br class=\'brs\'>').insertBefore('#placeholder_choice');

        $('<center class=\'centers\'><button class=\'command_button d-buttons\' value=\'normal\'>Normal</button></center><br class=\'brs\'>').insertBefore('#placeholder_choice');

        $('<center class=\'centers\'><button class=\'command_button d-buttons\' value=\'hard\'>Hard</button></center><br class=\'brs\'>').insertBefore('#placeholder_choice');

    }

    else if (button == 'easy') {

        clean();
        point = 800;
        Dif = 'easy';
        console.log("The difficulty is on " + Dif + ". You have " + point + " of points now.");
        $('<p class=\'texts\'>You are now playing on easy mode.</p>').insertBefore('#placeholder');

    }

    else if (button == 'normal') {

        clean();
        point = 400;
        Dif = 'normal';
        console.log("The difficulty is on " + Dif + ". You have " + point + " of points now.");
        $('<p class=\'texts\'>You are now playing on normal mode.</p>').insertBefore('#placeholder');

    }

    else if (button == 'hard') {

        clean();
        point = 200;
        Dif = 'hard';
        console.log("The difficulty is on " + Dif + ". You have " + point + " of points now.");
        $('<p class=\'texts\'>You are now playing on hard mode.</p>').insertBefore('#placeholder');

    }

});

// $('<p class=\'texts\'></p>').insertBefore('#placeholder');

// $('<center class=\'centers\'><button class=\'command_button buttons\' value=\' \'></button></center><br class=\'brs\'>').insertBefore('#placeholder_choice');

// $('<input type=\'text\' class=\'command_line lines\' size=\'50\' autofocus=\'autofocus\' autocomplete=\'off\'></input>').insertBefore('#placeholder').fadeIn(0);

//$('<button class=\'command_button e-buttons\' value=\'pistol\'>Pistol</button>').insertBefore('#placeholder_choice');

解决方法

您在某些地方拥有clear函数,而在其他地方则具有clean

根据您使用的IDE /编辑器及其配置方式,如果您实际上未在任何地方声明clean函数,我感觉它会自动导入第一个{{1 }}功能,它可以在您的目录中找到。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...