标签:nts src javascrip point div jquer his style log
<body> <input type="file" name="file" id="file" onClick="$(‘#file‘).click();" style="display:block" onChange="var img=getObjectURL(this.files[0]);$(‘#myimg‘).attr(‘src‘,img)" /> <img id="myimg" src="" style="pointer-events: none;"/> </body> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript"> function getObjectURL(file) { var url = null ; if (window.createObjectURL!=undefined) { // basic url = window.createObjectURL(file) ; } else if (window.URL!=undefined) { // mozilla(firefox) url = window.URL.createObjectURL(file) ; } else if (window.webkitURL!=undefined) { // webkit or chrome url = window.webkitURL.createObjectURL(file) ; } return url ; }; </script>
标签:nts src javascrip point div jquer his style log
原文地址:http://www.cnblogs.com/jinsuo/p/6045258.html