the code is as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<input type="file" onchange="fileChoosed(event)">
<img id="a">
<script>
function fileChoosed(event) {
console.log("aa");
let file = event.target.files[0],
fileName = file.name,
img = document.getElementById("a"),
fr = new FileReader(),
ts = this;
fr.addEventListener("load", () => {
let blob = "a";
console.log(fileName, img, blob); //
img.onload = (img, blob, fileName) => {
debugger;
view.insertPicture(img, blob, fileName); //
};
img.src = fr.result;
});
fr.readAsDataURL(file);
}
</script>
</body>
</html>
after searching for a long time, I couldn"t find the reason. Ask for help