change to cors(last)
This commit is contained in:
parent
3f844bfe60
commit
7f79f1773d
|
@ -1108,7 +1108,12 @@ input.addEventListener(
|
||||||
if (prev_val != new_val) {
|
if (prev_val != new_val) {
|
||||||
if (new_val.length > 3) {
|
if (new_val.length > 3) {
|
||||||
var start = 'https://www.fediversesearch.com/search/?keyword=' + new_val
|
var start = 'https://www.fediversesearch.com/search/?keyword=' + new_val
|
||||||
fetch(start)
|
fetch(start, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
}
|
||||||
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
response.text().then(function (text) {
|
response.text().then(function (text) {
|
||||||
|
@ -1129,7 +1134,7 @@ input.addEventListener(
|
||||||
var url = json.data[key]
|
var url = json.data[key]
|
||||||
urls =
|
urls =
|
||||||
urls +
|
urls +
|
||||||
`<a onclick="login('${url.url}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, `
|
`<a onclick="login('${url.uri}')" class="pointer" title="${url.uri}">${escapeHTML(url.title ? url.title : url.uri)}</a>, `
|
||||||
})
|
})
|
||||||
$('#ins-suggest').html(urls)
|
$('#ins-suggest').html(urls)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user