diff --git a/app/static/js/word_operation.js b/app/static/js/word_operation.js index a9af300..ea6a6e8 100644 --- a/app/static/js/word_operation.js +++ b/app/static/js/word_operation.js @@ -47,7 +47,7 @@ function unfamiliar(theWord) { function delete_word(theWord) { let username = $("#username").text(); - let word = $("#word_" + theWord).text(); + let word = theWord.replace('&', '&'); $.ajax({ type:"GET", url:"/" + username + "/" + word + "/del", @@ -104,6 +104,7 @@ function wordTemplate(word) { */ function removeWord(word) { // 根据词频信息删除元素 + word = word.replace('&', '&'); const element_to_remove = document.getElementById(`p_${word}`); if (element_to_remove != null) { element_to_remove.remove(); @@ -169,4 +170,4 @@ function compareWord(first, second) { return 1; } return 0; -} \ No newline at end of file +}