标签:viewport OLE body meta device ons port sda head
<!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> <form> 文件: <input type="file" id="myFile" name =‘myfile‘ onchange="getFileContent();"> <br> <input type="submit"> </form> <img src="" alt=""> <script> function getFileContent(){ var reader = new FileReader(); var file = document.querySelector(‘#myFile‘).files; console.log(file); reader.readAsDataURL(file[0]) reader.onload = function(){ console.log(123); document.querySelector(‘img‘).src = reader.result } } </script> </body> </html>
标签:viewport OLE body meta device ons port sda head
原文地址:https://www.cnblogs.com/tuziling/p/10182759.html