From a1955341c6c2495dd7c8f73727d341b780c38a6c Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Tue, 31 Jan 2023 16:39:11 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20bug=20501=20-=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=AD=97=E7=AC=A6&=E5=8A=A0=E5=85=A5=E7=94=9F=E8=AF=8D?= =?UTF-8?q?=E5=BA=93=E5=90=8E=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/word_operation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +}