2021-11-01 11:35:48 +08:00

27 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div class="container"></div>
<p class="label"></p>
<script>
// 根据指定的图片路径创建一个img元素
// 该函数需要返回一个Promise当图片加载完成后任务完成若图片加载失败任务失败
// 任务完成后需要提供的数据是图片DOM元素任务失败时需要提供失败的原因
// 提示img元素有两个事件load事件会在图像加载完成时触发error事件会在图像加载失败时触发
function createImage(imgUrl) {}
// 使用createImage函数创建一个图像图像路径自行定义
// 当图像成功加载后将图像宽高显示在p元素中当图像加载失败后输出加载失败的原因
// 使用createImage函数创建一个图像图像路径自行定义
// 当图像成功加载后将图像元素加入到container容器中当图像加载失败后输出加载失败的原因
</script>
</body>
</html>