当我尝试时,出现以下错误“ 获取http://localhost:60377/Icones/403(禁止)” 和“ 提供的HTMLImageElement处于“损坏”状态”将图像加载到ajax调用成功函数中。之前曾问过这个问题,但对于流星项目,在我的情况下,这是一个asp.net mvc项目。此代码段
//Inside the ajax's call success function
let iconName = JSON.parse(reponse);
let image_element = document.createElement('img');
let src = '/Icones/wifi.png';
if (iconName !== 'default.png' && iconName !== null) {
src = '/Icones/' +iconName';
}
image_element.setAttribute('src', src);
let wifiClient = new fabric.Image(image_element);
canvasFabric.add(wifiClient); //FabricJS canvas
我将不胜感激。