1
在測驗答案的「解釋」部分,我試圖包含一個鏈接,但html總是被剝離出來。無法獲取要顯示在js測驗結果中的鏈接
這是在.js文件的446行:
$('#quiz-form').append('<p class="special" id="special_' + key + '" ><strong>Correct answer(s): ' + answer + '</strong> » Explanation: ' + special + '</p>');
我已經試過鏈接和逃避我能找到的每一個變化,但他們都只是顯示標題爲純文本。下面是我嘗試過,這些都是目前在解釋部分爲每個第一六個問題:
special: "<a href='URL'>title</a>"
special: "<a href=\'URL\'>title</a>"
special: "<a href="URL">title</a>"
special: "<a href="\"URL\"">title</a>"
special: "<a href=\x22URL\x22>title</a>"
special: "<a href=\x27URL\x27>title</a>"
不幸的是,沒有辦法直接鏈接到答案頁面 - 爲了看到屏幕截圖中顯示的解釋,您必須弄錯前六個問題。
ETA:現在我正在編碼尖括號,整個a href
字符串顯示爲文本。
special: "<a href='URL'>title</a>"
被示出作爲
<a href='https://www.lawlessfrench.com/vocabulary/introductions/'>Introductions</a>
進展?
https://www.lawlessfrench.com/quizzes-and-tests/proficiency-test-1/
https://www.lawlessfrench.com/wp-content/themes/cassie/js/proficiency-test-1.js
試過了,沒有喜悅。 – lkl
嘗試剝離代碼,直到它工作;這將幫助您縮小範圍以查找錯誤。也許網頁上的其他JavaScript文件有衝突。 –