小编Raú*_*ate的帖子

显示 Google 云端硬盘中的图像时遇到问题

我正在努力使用 JavaScript 在我的 HTML 页面上显示来自 Google Drive 的图像。遵循在线指南并没有完全解决我的问题。

HTML(索引.html):

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Google Drive Image</title>
</head>
<body>
  <img id="imageElement" alt="A lovely image">
  <script src="script.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

JavaScript(script.js):

const fileId = '1BEW9tkgVKlp_ebUc17LkXDH-mnPc4ome';
const imageElement = document.getElementById('imageElement');

async function fetchGoogleDriveImage(fileId) {
  try {
    const response = await fetch(`https://drive.google.com/uc?id=${fileId}`);
    const url = URL.createObjectURL(await response.blob());
    imageElement.src = url;
  } catch (error) {
    console.error('Error fetching the image:', error);
  }
}

fetchGoogleDriveImage(fileId);
Run Code Online (Sandbox Code Playgroud)

语境:

  • Google 云端硬盘中的图像设置为“知道链接的任何人都可以查看”。
  • 尽管如此,图像不会在浏览器中加载,并且控制台显示错误。

附加 HTML(纯 …

html javascript image

11
推荐指数
3
解决办法
4143
查看次数

找不到所需的库 libhostfxr.so。网络核心Linux

 \xe2\x9d\xaf dotnet ef   \nA fatal error occurred. The required library libhostfxr.so could not be found.\nIf this is a self-contained application, that library should exist in [/home/ru/.dotnet/tools/.store/dotnet-ef/6.0.2/dotnet-ef/6.0.2/tools/netcoreapp3.1/any/].\nIf this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].\n\nThe .NET runtime can be found at:\n  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.2\n\n~ \n
Run Code Online (Sandbox Code Playgroud)\n

dotnet ef 不起作用\n运行命令后不起作用,我该怎么办?

\n

.net entity-framework-core .net-core asp.net-core

4
推荐指数
1
解决办法
1万
查看次数