浏览器兼容性参考:
https://developer.mozilla.org/zh-CN/docs/Web/API/URL/createObjectURL
<script type="text/javascript"> $(document).ready(function () { $("#File1").bind("change", function () { var f = document.getElementById('File1').files[0]; var src = window.URL.createObjectURL(f); $("#img1").attr("src", src) }) }); </script>