about 9 years ago
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <img id="thumbnail" src="test.png" alt="Image"/> <div style="clear: both;"></div> <input type="file" name="file" id="file"/> <div style="clear: both;"></div> <button id="btn">Click</button> <script type="text/javascript"> $(document).ready(function() { $(document).on('click', '#btn', function() { var reader = new FileReader(); reader.onload = function (e) { $('#thumbnail').attr('src', e.target.result); } reader.readAsDataURL(file.files[0]); }); }); </script> </body> </html>
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)