我正在努力使用 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)
语境:
附加 HTML(纯 …
\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~ \nRun Code Online (Sandbox Code Playgroud)\ndotnet ef 不起作用\n运行命令后不起作用,我该怎么办?
\n