我正在从我的 firebase 数据库中检索图像 URL,然后使用 URL 在我的页面中显示图像
问题是我收到此错误(PS 我正在使用来自维基百科的图片 URL)
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://fr.wikipedia.org/wiki/Capital_(magazine) with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Cross-Origin Read Blocking (CORB) blocked cross-origin response <URL> with MIME type text/html. See <URL> for more details.
这是我的代码:
var databaseRef = firebase.database().ref('titres/');
databaseRef.once('value' , function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var childKey = childSnapshot.key;
var childData = childSnapshot.val();
const list = document.getElementById('favoris');
[childSnapshot].forEach(item => {
// add title as an option in the select tag
var table = document.getElementById("myTable");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
let img = document.createElement('IMG');
cell2.innerHTML=item.val().nom;
if (item.val().URL_logo != undefined && item.val().URL_logo !="" && item.val()!=undefined && item.val().URL_logo !=" " )
{ console.log(item.val().nom)
console.log(item.val().URL_logo)
img.src=item.val().URL_logo ;
img.height="42"
img.width="100"
cell1.appendChild(img)
}
else{ cell1.innerHTML=item.val().nom;}
任何想法如何解决这一问题 ?