不能正确下载图片,并且不能更新图片链接

Started by goujibing, August 30, 2022, 03:28:45 AM

Previous topic - Next topic

goujibing

如题,我遇到不能正确下载图片,并且不能更新图片链接的问题。请帮帮我!!!
网址是docs.easyeda.com,网页代码如下:
// 对图片的处理
    const imgList = $("img");
    for (let i = 0; i < imgList.length; i += 1) {
      const enLink = $(imgList).attr("src").indexOf("../../../_images/");
      if (enLink > -1) {
        const enImgLink = $(imgList)
          .attr("src")
          .replace(/..\/..\/..\/_images\//, "https://image.easyeda.com/images/");
        $(imgList).attr("src", enImgLink);
      }
    }