[HTML]html读取本地文件并显示
<html> <body> <script script type="text/javascript"> function show() { var reader = new FileReader(); reader.onload = function() { alert(this.result) } var f = document.getElementById("filePicker").files[0]; reader.readAsText(f); } </script> <input type="file" name="file" id="filePicker"/> <div id = "div1"> </div> <input type="button" value = "显示" onclick="show()"/> </body> </html>