Fix bug 501 - 特殊字符&加入生词库后删除按钮失效

pull/81/head
Hui Lan 2023-01-31 16:39:11 +08:00
parent 92a8b4a994
commit a1955341c6
1 changed files with 3 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function unfamiliar(theWord) {
function delete_word(theWord) { function delete_word(theWord) {
let username = $("#username").text(); let username = $("#username").text();
let word = $("#word_" + theWord).text(); let word = theWord.replace('&', '&');
$.ajax({ $.ajax({
type:"GET", type:"GET",
url:"/" + username + "/" + word + "/del", url:"/" + username + "/" + word + "/del",
@ -104,6 +104,7 @@ function wordTemplate(word) {
*/ */
function removeWord(word) { function removeWord(word) {
// 根据词频信息删除元素 // 根据词频信息删除元素
word = word.replace('&', '&');
const element_to_remove = document.getElementById(`p_${word}`); const element_to_remove = document.getElementById(`p_${word}`);
if (element_to_remove != null) { if (element_to_remove != null) {
element_to_remove.remove(); element_to_remove.remove();