mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
commit
ba8a410d4c
@ -147,6 +147,16 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
function sanitizeHTMLEntities(str) {
|
||||||
|
if (str && typeof str === 'string') {
|
||||||
|
str = str.replace(/</g,"<");
|
||||||
|
str = str.replace(/>/g,">");
|
||||||
|
str = str.replace(/<em>/g,"<em>");
|
||||||
|
str = str.replace(/<\/em>/g,"<\/em>");
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
function httpGet(theUrl) {
|
function httpGet(theUrl) {
|
||||||
var xmlHttp = new XMLHttpRequest();
|
var xmlHttp = new XMLHttpRequest();
|
||||||
xmlHttp.open("GET", theUrl, false); // false for synchronous request
|
xmlHttp.open("GET", theUrl, false); // false for synchronous request
|
||||||
@ -169,7 +179,8 @@
|
|||||||
lastRequest.open("GET", theUrl, true);
|
lastRequest.open("GET", theUrl, true);
|
||||||
lastRequest.onload = function (e) {
|
lastRequest.onload = function (e) {
|
||||||
if (lastRequest.readyState === 4 && lastRequest.status === 200) {
|
if (lastRequest.readyState === 4 && lastRequest.status === 200) {
|
||||||
let httpResults = JSON.parse(lastRequest.responseText);
|
let sanitizedResponseText = sanitizeHTMLEntities(lastRequest.responseText);
|
||||||
|
let httpResults = JSON.parse(sanitizedResponseText);
|
||||||
results.innerHTML = '';
|
results.innerHTML = '';
|
||||||
|
|
||||||
let processingTimeMs = httpResults.processingTimeMs;
|
let processingTimeMs = httpResults.processingTimeMs;
|
||||||
|
Loading…
Reference in New Issue
Block a user