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

Merged
mrlan merged 1 commits from Bug501-Hui into master 2023-01-31 16:45:50 +08:00
        <p id='p_a&amp;' class="new-word" >
            <a id="word_a&amp;"  class="btn btn-light" href='http://youdao.com/w/eng/a&amp;/#keyfrom=dict2.index'
            role="button">a&amp;</a>
            ( <a id="freq_a&amp;" title="a&amp;">1</a> )
            <a class="btn btn-success" onclick="familiar('a&amp;')" role="button">熟悉</a>
            <a class="btn btn-warning" onclick="unfamiliar('a&amp;')" role="button">不熟悉</a>
            <a class="btn btn-danger" onclick="delete_word('a&amp;')" role="button">删除</a>
        </p>

如果HTML的id是 p_a&amp;, 则下面两行代码中, element_to_remove 的值是 null

word = 'a&amp;'; 
element_to_remove = document.getElementById(`p_${word}`);

解决方法,将 'a&' 替换为 'a&'

Hui

<p id='p_a&amp;' class="new-word" > <a id="word_a&amp;" class="btn btn-light" href='http://youdao.com/w/eng/a&amp;/#keyfrom=dict2.index' role="button">a&amp;</a> ( <a id="freq_a&amp;" title="a&amp;">1</a> ) <a class="btn btn-success" onclick="familiar('a&amp;')" role="button">熟悉</a> <a class="btn btn-warning" onclick="unfamiliar('a&amp;')" role="button">不熟悉</a> <a class="btn btn-danger" onclick="delete_word('a&amp;')" role="button">删除</a> </p> 如果HTML的id是 `p_a&amp;`, 则下面两行代码中, `element_to_remove` 的值是 `null` 。 ``` word = 'a&amp;'; element_to_remove = document.getElementById(`p_${word}`); ``` 解决方法,将 'a&amp;' 替换为 'a&' Hui
mrlan added 1 commit 2023-01-31 16:44:56 +08:00
mrlan merged commit 43c719b6b2 into master 2023-01-31 16:45:50 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrlan/EnglishPal#81
There is no content yet.